summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMark Brown2013-07-08 10:14:45 +0200
committerMark Brown2013-07-15 12:20:08 +0200
commit891636ea27ef42d92a420185d2ccbe190ba00a23 (patch)
tree85ced97d49b3fa810e424bd8ab566e8a0cb44b9e /drivers/regulator/core.c
parentregulator: core: Make set_voltage_tol() try for mid-range first (diff)
downloadkernel-qcow2-linux-891636ea27ef42d92a420185d2ccbe190ba00a23.tar.gz
kernel-qcow2-linux-891636ea27ef42d92a420185d2ccbe190ba00a23.tar.xz
kernel-qcow2-linux-891636ea27ef42d92a420185d2ccbe190ba00a23.zip
regulator: core: Drop references on supply regulator when unregistering
Signed-off-by: Mark Brown <broonie@linaro.org>
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 288c75abc190..1510333bcf0d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3740,8 +3740,11 @@ void regulator_unregister(struct regulator_dev *rdev)
if (rdev == NULL)
return;
- if (rdev->supply)
+ if (rdev->supply) {
+ while (rdev->use_count--)
+ regulator_disable(rdev->supply);
regulator_put(rdev->supply);
+ }
mutex_lock(&regulator_list_mutex);
debugfs_remove_recursive(rdev->debugfs);
flush_work(&rdev->disable_work.work);