diff options
| author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-06 23:00:53 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-07 20:51:12 -0400 |
| commit | 2b5a24a01df12fbfa3e702ad7efae27bcb852e33 (patch) | |
| tree | 28d1d703f0266edd262d96eecbf7ecfecdfc580d | |
| parent | f2889e650a8dbd51644997aef7bae71d6ac4d423 (diff) | |
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>
| -rw-r--r-- | drivers/regulator/core.c | 3 |
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) | |||
| 1724 | if (regulator->always_on) | 1724 | if (regulator->always_on) |
| 1725 | return 0; | 1725 | return 0; |
| 1726 | 1726 | ||
| 1727 | if (!ms) | ||
| 1728 | return regulator_disable(regulator); | ||
| 1729 | |||
| 1727 | mutex_lock(&rdev->mutex); | 1730 | mutex_lock(&rdev->mutex); |
| 1728 | rdev->deferred_disables++; | 1731 | rdev->deferred_disables++; |
| 1729 | mutex_unlock(&rdev->mutex); | 1732 | mutex_unlock(&rdev->mutex); |
