regulator: Warn when unregistering an in-use regulator
We're probably going to start oopsing fairly soon after this happens.
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Liam Girdwood <[email protected]>
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index e11c222..79a6910 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2253,6 +2253,7 @@
return;
mutex_lock(®ulator_list_mutex);
+ WARN_ON(rdev->open_count);
unset_regulator_supplies(rdev);
list_del(&rdev->list);
if (rdev->supply)