diff options
author | Lee Jones <lee.jones@linaro.org> | 2012-12-10 03:55:52 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-10 09:12:41 -0500 |
commit | ad0b8b9e82b63ad2cc5e6822448adc897f49a5c4 (patch) | |
tree | 2e32a9604aecb94190ac6ecf02de948875a9cf5d /drivers/regulator/gpio-regulator.c | |
parent | ec4f7b88b4a89253ec922d48f77b269ce5cffc2c (diff) |
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: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/gpio-regulator.c')
-rw-r--r-- | drivers/regulator/gpio-regulator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c index 8c4e23739494..84e585fca795 100644 --- a/drivers/regulator/gpio-regulator.c +++ b/drivers/regulator/gpio-regulator.c | |||
@@ -174,7 +174,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np) | |||
174 | if (!config->gpios) | 174 | if (!config->gpios) |
175 | return ERR_PTR(-ENOMEM); | 175 | return ERR_PTR(-ENOMEM); |
176 | 176 | ||
177 | for (i = 0; config->nr_gpios; i++) { | 177 | for (i = 0; i < config->nr_gpios; i++) { |
178 | gpio = of_get_named_gpio(np, "gpios", i); | 178 | gpio = of_get_named_gpio(np, "gpios", i); |
179 | if (gpio < 0) | 179 | if (gpio < 0) |
180 | break; | 180 | break; |