提交 ad0b8b9e 编写于 作者: L Lee Jones 提交者: Mark Brown

regulator: gpio-regulator: Fix logical error in for() loop

The cond-statement of this particular for() loop will always be
true as long as at least one voltage-shifting GPIO is present.
If it wasn't for the break below, we'd be stuck in a forever loop.
This patch inserts the correct cond-statement into the statement.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 ec4f7b88
......@@ -174,7 +174,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
if (!config->gpios)
return ERR_PTR(-ENOMEM);
for (i = 0; config->nr_gpios; i++) {
for (i = 0; i < config->nr_gpios; i++) {
gpio = of_get_named_gpio(np, "gpios", i);
if (gpio < 0)
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册