From: Mark Brown Date: Mon, 3 Oct 2011 21:42:43 +0000 (+0100) Subject: regulator: Fix return code from regulator_disable_deferred() X-Git-Tag: v3.3-rc1~14^2~568 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa59802dedac98dc95310a456121cec6a9d6b63f;p=platform%2Fkernel%2Flinux-exynos.git 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 --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index d0bde70..9e4c123 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1599,13 +1599,18 @@ static void regulator_disable_work(struct work_struct *work) int regulator_disable_deferred(struct regulator *regulator, int ms) { struct regulator_dev *rdev = regulator->rdev; + int ret; mutex_lock(&rdev->mutex); rdev->deferred_disables++; mutex_unlock(&rdev->mutex); - return schedule_delayed_work(&rdev->disable_work, - msecs_to_jiffies(ms)); + ret = schedule_delayed_work(&rdev->disable_work, + msecs_to_jiffies(ms)); + if (ret < 0) + return ret; + else + return 0; } EXPORT_SYMBOL_GPL(regulator_disable_deferred);