diff mbox

[3.5.y.z,extended,stable] Patch "regulator: fixed regulator_bulk_enable unwinding code" has been added to staging queue

Message ID 1366796209-7711-1-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques April 24, 2013, 9:36 a.m. UTC
This is a note to let you know that I have just added a patch titled

    regulator: fixed regulator_bulk_enable unwinding code

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

From 4078c01c1faff6f980feb9d06dfc5fd96c473346 Mon Sep 17 00:00:00 2001
From: Andrzej Hajda <a.hajda@samsung.com>
Date: Fri, 1 Mar 2013 12:24:05 +0100
Subject: [PATCH] regulator: fixed regulator_bulk_enable unwinding code

commit fbe31057fafebdc2811a7101b8b4a0460f5417d1 upstream.

Unwinding code disables all successfully enabled regulators.
Error is logged for every failed regulator.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/regulator/core.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--
1.8.1.2
diff mbox

Patch

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 8b4b382..4a4d12e 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2769,9 +2769,13 @@  int regulator_bulk_enable(int num_consumers,
 	return 0;

 err:
-	pr_err("Failed to enable %s: %d\n", consumers[i].supply, ret);
-	while (--i >= 0)
-		regulator_disable(consumers[i].consumer);
+	for (i = 0; i < num_consumers; i++) {
+		if (consumers[i].ret < 0)
+			pr_err("Failed to enable %s: %d\n", consumers[i].supply,
+			       consumers[i].ret);
+		else
+			regulator_disable(consumers[i].consumer);
+	}

 	return ret;
 }