summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-07 11:00:53 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-08 08:51:12 +0800
commit2b5a24a01df12fbfa3e702ad7efae27bcb852e33 (patch)
tree28d1d703f0266edd262d96eecbf7ecfecdfc580d /drivers/regulator
parentf2889e650a8dbd51644997aef7bae71d6ac4d423 (diff)
downloadlinux-2b5a24a01df12fbfa3e702ad7efae27bcb852e33.tar.bz2
regulator: core: Fast path non-deferred disables
Users (especially framework code) may end up passing in a zero deferral time depending on runtime conditions or configuration. If they do then just call regulator_disable() directly to save scheduling. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 50977a69f09a..ed376d9f525d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1724,6 +1724,9 @@ int regulator_disable_deferred(struct regulator *regulator, int ms)
if (regulator->always_on)
return 0;
+ if (!ms)
+ return regulator_disable(regulator);
+
mutex_lock(&rdev->mutex);
rdev->deferred_disables++;
mutex_unlock(&rdev->mutex);