提交 b8c77ff6 编写于 作者: D Dmitry Torokhov 提交者: Mark Brown

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: NDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 a8bd42a9
......@@ -3687,21 +3687,17 @@ int regulator_bulk_force_disable(int num_consumers,
struct regulator_bulk_data *consumers)
{
int i;
int ret;
int ret = 0;
for (i = 0; i < num_consumers; i++)
for (i = 0; i < num_consumers; i++) {
consumers[i].ret =
regulator_force_disable(consumers[i].consumer);
for (i = 0; i < num_consumers; i++) {
if (consumers[i].ret != 0) {
/* Store first error for reporting */
if (consumers[i].ret && !ret)
ret = consumers[i].ret;
goto out;
}
}
return 0;
out:
return ret;
}
EXPORT_SYMBOL_GPL(regulator_bulk_force_disable);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册