[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1373271336-29943-1-git-send-email-broonie@kernel.org>
Date: Mon, 8 Jul 2013 09:15:36 +0100
From: Mark Brown <broonie@...nel.org>
To: Liam Girdwood <lgirdwood@...il.com>
Cc: linux-kernel@...r.kernel.org, linaro-kernel@...ts.linaro.org,
Mark Brown <broonie@...aro.org>
Subject: [PATCH] regulator: core: Drop references on supply regulator when unregistering
From: Mark Brown <broonie@...aro.org>
Signed-off-by: Mark Brown <broonie@...aro.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(®ulator_list_mutex);
debugfs_remove_recursive(rdev->debugfs);
flush_work(&rdev->disable_work.work);
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists