summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2014-11-03 19:12:07 +0100
committerMark Brown <broonie@kernel.org>2014-11-07 11:30:25 +0000
commit679c038f544e46803d4fce16636747c3e77af4f1 (patch)
tree01269633f8d42314242a83203521b7d2bc0db94a /drivers/regulator
parent2454f8d15cf75781a2714e99badbfbc2f5a7dacb (diff)
regulator: tps65090: Fix gpio initialization
The config is used for multiple regulators within a for loop. The config field is not cleared before it is used for the next item. To avoid any issues this patch adds a proper initialization for the config->ena_gpio field in case no gpio is available. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/tps65090-regulator.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c
index 2e92aa8718cc..f1df4423d361 100644
--- a/drivers/regulator/tps65090-regulator.c
+++ b/drivers/regulator/tps65090-regulator.c
@@ -314,6 +314,9 @@ static void tps65090_configure_regulator_config(
config->ena_gpio = tps_pdata->gpio;
config->ena_gpio_initialized = true;
config->ena_gpio_flags = gpio_flag;
+ } else {
+ config->ena_gpio = -EINVAL;
+ config->ena_gpio_initialized = false;
}
}