diff options
author | Mark Brown <broonie@linaro.org> | 2013-07-08 04:14:45 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-15 06:20:08 -0400 |
commit | 891636ea27ef42d92a420185d2ccbe190ba00a23 (patch) | |
tree | 85ced97d49b3fa810e424bd8ab566e8a0cb44b9e | |
parent | dc9ceed6a12aff627c81e01ada191e8a23fcbe3e (diff) |
regulator: core: Drop references on supply regulator when unregistering
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/regulator/core.c | 5 |
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) | |||
3740 | if (rdev == NULL) | 3740 | if (rdev == NULL) |
3741 | return; | 3741 | return; |
3742 | 3742 | ||
3743 | if (rdev->supply) | 3743 | if (rdev->supply) { |
3744 | while (rdev->use_count--) | ||
3745 | regulator_disable(rdev->supply); | ||
3744 | regulator_put(rdev->supply); | 3746 | regulator_put(rdev->supply); |
3747 | } | ||
3745 | mutex_lock(®ulator_list_mutex); | 3748 | mutex_lock(®ulator_list_mutex); |
3746 | debugfs_remove_recursive(rdev->debugfs); | 3749 | debugfs_remove_recursive(rdev->debugfs); |
3747 | flush_work(&rdev->disable_work.work); | 3750 | flush_work(&rdev->disable_work.work); |