diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-03 17:42:43 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-04 11:50:16 -0400 |
commit | aa59802dedac98dc95310a456121cec6a9d6b63f (patch) | |
tree | a11ba91bd5636199d7c83ca93bdadc27acfc3e83 /drivers | |
parent | 38f3f31a0a797bdbcc0cdb12553bbecc2f9a91c4 (diff) |
regulator: Fix return code from regulator_disable_deferred()
schedule_delayed_work() returns a bool indicating if the work was already
queued when it succeeds so we need to squash a true down to zero.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/core.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index d0bde70f3466..9e4c123c4028 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -1599,13 +1599,18 @@ static void regulator_disable_work(struct work_struct *work) | |||
1599 | int regulator_disable_deferred(struct regulator *regulator, int ms) | 1599 | int regulator_disable_deferred(struct regulator *regulator, int ms) |
1600 | { | 1600 | { |
1601 | struct regulator_dev *rdev = regulator->rdev; | 1601 | struct regulator_dev *rdev = regulator->rdev; |
1602 | int ret; | ||
1602 | 1603 | ||
1603 | mutex_lock(&rdev->mutex); | 1604 | mutex_lock(&rdev->mutex); |
1604 | rdev->deferred_disables++; | 1605 | rdev->deferred_disables++; |
1605 | mutex_unlock(&rdev->mutex); | 1606 | mutex_unlock(&rdev->mutex); |
1606 | 1607 | ||
1607 | return schedule_delayed_work(&rdev->disable_work, | 1608 | ret = schedule_delayed_work(&rdev->disable_work, |
1608 | msecs_to_jiffies(ms)); | 1609 | msecs_to_jiffies(ms)); |
1610 | if (ret < 0) | ||
1611 | return ret; | ||
1612 | else | ||
1613 | return 0; | ||
1609 | } | 1614 | } |
1610 | EXPORT_SYMBOL_GPL(regulator_disable_deferred); | 1615 | EXPORT_SYMBOL_GPL(regulator_disable_deferred); |
1611 | 1616 | ||