mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: core: Drop references on supply regulator when unregistering
@ 2013-07-08  8:15 Mark Brown
  0 siblings, 0 replies; only message in thread
From: Mark Brown @ 2013-07-08  8:15 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: linux-kernel, linaro-kernel, Mark Brown

From: Mark Brown <broonie@linaro.org>

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 drivers/regulator/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index e8604be..cfb17e6 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3827,8 +3827,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);
-- 
1.8.3.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-08  8:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-08  8:15 [PATCH] regulator: core: Drop references on supply regulator when unregistering Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®