Skip to content

Commit

Permalink
regulator: core: Drop references on supply regulator when unregistering
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Mark Brown committed Jul 15, 2013
1 parent dc9ceed commit 891636e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 891636e

Please sign in to comment.