summaryrefslogtreecommitdiff
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorEvan Wilson <evan@oliodevices.com>2016-01-21 02:10:15 +0000
committerGerrit Code Review <gerrit2@ip-172-31-25-77.us-west-1.compute.internal>2015-04-16 10:08:13 +0000
commitd1294a7ffe9438c3449b4e74c381c081cc6f786e (patch)
tree260c86fb18061682a20efeb9f2dd97176d329817 /drivers/regulator/core.c
parent7889f21e6e3df3d0962fdae0a81e7a43216c98ae (diff)
parent8acd0bee36f61b5a8d2336204710f0a2b761209d (diff)
downloadolio-linux-3.10-d1294a7ffe9438c3449b4e74c381c081cc6f786e.tar.xz
olio-linux-3.10-d1294a7ffe9438c3449b4e74c381c081cc6f786e.zip
Merge "Adding a recovery mechanism to the accelerometer. It will not hard reset the regulator if it detects a corrupt WAI register, or if there has not been any accelerometer events in 20 minutes." into android-3.10-bringup
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 815d6df8bd5..75329f01037 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1824,8 +1824,11 @@ int regulator_force_disable(struct regulator *regulator)
mutex_unlock(&rdev->mutex);
if (rdev->supply)
- while (rdev->open_count--)
+ while (rdev->open_count > 0)
+ {
+ rdev->open_count--;
regulator_disable(rdev->supply);
+ }
return ret;
}