Skip to contentSkip to conversation

regulator: core: Complain if we can't reenable a supply

PATCH New Mark Brown 1 participant 1 message Mar 28, 2012 Voltage and current regulator framework

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 regulator: core: Complain if we can't reenable a supply

When cleaning up after a failed bulk_disable() we try to reenable any supplies that we did manage to disable - complain if we fail to do that when we try.

---
 drivers/regulator/core.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/regulator/core.c +7 -3
index 957f1d1..e265632 100644
@@ -2566,7 +2566,7 @@ int regulator_bulk_disable(int num_consumers,
 			   struct regulator_bulk_data *consumers)
 {
 	int i;
-	int ret;
+	int ret, r;
 
 	for (i = num_consumers - 1; i >= 0; --i) {
 		ret = regulator_disable(consumers[i].consumer);
@@ -2578,8 +2578,12 @@ int regulator_bulk_disable(int num_consumers,
 
 err:
 	pr_err("Failed to disable %s: %d\n", consumers[i].supply, ret);
-	for (++i; i < num_consumers; ++i)
-		(void)regulator_enable(consumers[i].consumer);
+	for (++i; i < num_consumers; ++i) {
+		r = regulator_enable(consumers[i].consumer);
+		if (r != 0)
+			pr_err("Failed to reename %s: %d\n",
+			       consumers[i].supply, r);
+	}
 
 	return ret;
 }
Signature · 1 line
1.7.9.1