regulator: fixed regulator_bulk_enable unwinding code
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>
This commit is contained in:
parent
2730fd82cb
commit
fbe31057fa
1 changed files with 7 additions and 3 deletions
|
@ -3057,9 +3057,13 @@ int regulator_bulk_enable(int num_consumers,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
pr_err("Failed to enable %s: %d\n", consumers[i].supply, ret);
|
for (i = 0; i < num_consumers; i++) {
|
||||||
while (--i >= 0)
|
if (consumers[i].ret < 0)
|
||||||
regulator_disable(consumers[i].consumer);
|
pr_err("Failed to enable %s: %d\n", consumers[i].supply,
|
||||||
|
consumers[i].ret);
|
||||||
|
else
|
||||||
|
regulator_disable(consumers[i].consumer);
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue