summaryrefslogtreecommitdiff
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c9
1 files changed, 7 insertions, 2 deletions
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);