Commit fbe31057 authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Mark Brown

regulator: fixed regulator_bulk_enable unwinding code

Unwinding code disables all successfully enabled regulators.
Error is logged for every failed regulator.
Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 2730fd82
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment