]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: Only enable disabled regulators on resume
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>
Mon, 2 Mar 2015 20:40:39 +0000 (21:40 +0100)
committerMark Brown <broonie@kernel.org>
Sun, 8 Mar 2015 19:40:16 +0000 (19:40 +0000)
commit840f5c2c7b0db91b23653b21a32d80710d246a30
treed35bb0b948c53be97a96a776acde955e0d24363c
parent9cbe621030a9cce16d27329dac74fd4b1c1d9412
regulator: Only enable disabled regulators on resume

The _regulator_do_enable() call ought to be a no-op when called on an
already-enabled regulator.  However, as an optimization
_regulator_enable() doesn't call _regulator_do_enable() on an already
enabled regulator.  That means we never test the case of calling
_regulator_do_enable() during normal usage and there may be hidden
bugs or warnings.  We have seen warnings issued by the tps65090 driver
and bugs when using the GPIO enable pin.

Let's match the same optimization that _regulator_enable() in
regulator_suspend_finish().  That may speed up suspend/resume and also
avoids exposing hidden bugs.

[Use much clearer commit message from Doug Anderson]

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
drivers/regulator/core.c