mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-12 12:22:42 +00:00
regulator: core: simplify regulator_bulk_force_disable()
There is no need to have two loops there, we can store error for subsequent reporting. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
a8bd42a977
commit
b8c77ff690
@ -3687,21 +3687,17 @@ int regulator_bulk_force_disable(int num_consumers,
|
|||||||
struct regulator_bulk_data *consumers)
|
struct regulator_bulk_data *consumers)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int ret;
|
int ret = 0;
|
||||||
|
|
||||||
for (i = 0; i < num_consumers; i++)
|
for (i = 0; i < num_consumers; i++) {
|
||||||
consumers[i].ret =
|
consumers[i].ret =
|
||||||
regulator_force_disable(consumers[i].consumer);
|
regulator_force_disable(consumers[i].consumer);
|
||||||
|
|
||||||
for (i = 0; i < num_consumers; i++) {
|
/* Store first error for reporting */
|
||||||
if (consumers[i].ret != 0) {
|
if (consumers[i].ret && !ret)
|
||||||
ret = consumers[i].ret;
|
ret = consumers[i].ret;
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
out:
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(regulator_bulk_force_disable);
|
EXPORT_SYMBOL_GPL(regulator_bulk_force_disable);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user