projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2730fd8
)
regulator: fixed regulator_bulk_enable unwinding code
author
Andrzej Hajda
<
[email protected]
>
Fri, 1 Mar 2013 11:24:05 +0000
(12:24 +0100)
committer
Mark Brown
<
[email protected]
>
Fri, 1 Mar 2013 12:03:46 +0000
(20:03 +0800)
Unwinding code disables all successfully enabled regulators.
Error is logged for every failed regulator.
Signed-off-by: Andrzej Hajda <
[email protected]
>
Signed-off-by: Kyungmin Park <
[email protected]
>
Signed-off-by: Mark Brown <
[email protected]
>
drivers/regulator/core.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/core.c
b/drivers/regulator/core.c
index da9782bd27d0a182d32578c4779481072d0657ef..4a7790c58257d6121231ff12139bdbdad6622c83 100644
(file)
--- a/
drivers/regulator/core.c
+++ b/
drivers/regulator/core.c
@@
-3057,9
+3057,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;
}