diff options
author | Mark Brown <broonie@kernel.org> | 2017-09-04 12:54:34 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-09-04 12:54:34 -0400 |
commit | a69064e75ee6303f505f256a675c20e0e54c4f2c (patch) | |
tree | e935e737ad8d99a6dc45716d5a8f7b8e261f6a77 | |
parent | 569dbb88e80deb68974ef6fdd6a13edb9d686261 (diff) | |
parent | c9ccaa0cac3fc8e7d17a668aabfdf632c7c0517a (diff) |
Merge remote-tracking branch 'regulator/fix/core' into regulator-linus
-rw-r--r-- | drivers/regulator/core.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index e567fa54980b..9f4d484eb25d 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -2396,6 +2396,14 @@ static void regulator_disable_work(struct work_struct *work) | |||
2396 | count = rdev->deferred_disables; | 2396 | count = rdev->deferred_disables; |
2397 | rdev->deferred_disables = 0; | 2397 | rdev->deferred_disables = 0; |
2398 | 2398 | ||
2399 | /* | ||
2400 | * Workqueue functions queue the new work instance while the previous | ||
2401 | * work instance is being processed. Cancel the queued work instance | ||
2402 | * as the work instance under processing does the job of the queued | ||
2403 | * work instance. | ||
2404 | */ | ||
2405 | cancel_delayed_work(&rdev->disable_work); | ||
2406 | |||
2399 | for (i = 0; i < count; i++) { | 2407 | for (i = 0; i < count; i++) { |
2400 | ret = _regulator_disable(rdev); | 2408 | ret = _regulator_disable(rdev); |
2401 | if (ret != 0) | 2409 | if (ret != 0) |
@@ -2439,10 +2447,10 @@ int regulator_disable_deferred(struct regulator *regulator, int ms) | |||
2439 | 2447 | ||
2440 | mutex_lock(&rdev->mutex); | 2448 | mutex_lock(&rdev->mutex); |
2441 | rdev->deferred_disables++; | 2449 | rdev->deferred_disables++; |
2450 | mod_delayed_work(system_power_efficient_wq, &rdev->disable_work, | ||
2451 | msecs_to_jiffies(ms)); | ||
2442 | mutex_unlock(&rdev->mutex); | 2452 | mutex_unlock(&rdev->mutex); |
2443 | 2453 | ||
2444 | queue_delayed_work(system_power_efficient_wq, &rdev->disable_work, | ||
2445 | msecs_to_jiffies(ms)); | ||
2446 | return 0; | 2454 | return 0; |
2447 | } | 2455 | } |
2448 | EXPORT_SYMBOL_GPL(regulator_disable_deferred); | 2456 | EXPORT_SYMBOL_GPL(regulator_disable_deferred); |