提交 aa59802d 编写于 作者: M Mark Brown

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: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 38f3f31a
...@@ -1599,13 +1599,18 @@ static void regulator_disable_work(struct work_struct *work) ...@@ -1599,13 +1599,18 @@ static void regulator_disable_work(struct work_struct *work)
int regulator_disable_deferred(struct regulator *regulator, int ms) int regulator_disable_deferred(struct regulator *regulator, int ms)
{ {
struct regulator_dev *rdev = regulator->rdev; struct regulator_dev *rdev = regulator->rdev;
int ret;
mutex_lock(&rdev->mutex); mutex_lock(&rdev->mutex);
rdev->deferred_disables++; rdev->deferred_disables++;
mutex_unlock(&rdev->mutex); mutex_unlock(&rdev->mutex);
return schedule_delayed_work(&rdev->disable_work, ret = schedule_delayed_work(&rdev->disable_work,
msecs_to_jiffies(ms)); msecs_to_jiffies(ms));
if (ret < 0)
return ret;
else
return 0;
} }
EXPORT_SYMBOL_GPL(regulator_disable_deferred); EXPORT_SYMBOL_GPL(regulator_disable_deferred);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册