summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/wm8994-regulator.c
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2014-11-03 19:12:04 +0100
committerMark Brown <broonie@kernel.org>2014-11-07 12:30:25 +0100
commit1de3821ace8200432993821bfda043827029de2a (patch)
tree0cbde00f92a160441e1d9928cbbc26e856d0b371 /drivers/regulator/wm8994-regulator.c
parentregulator: Add ena_gpio_initialized to regulator_config (diff)
downloadlinux-1de3821ace8200432993821bfda043827029de2a.tar.xz
linux-1de3821ace8200432993821bfda043827029de2a.zip
regulator: Set ena_gpio_initialized in regulator drivers
This patch sets ena_gpio_initialized for all drivers which set a ena_gpio from parsed DT properties. Drivers using pdata may get zero initialized pdata and therefore copy a 0 into the regulator_config ena_gpio field. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/wm8994-regulator.c')
-rw-r--r--drivers/regulator/wm8994-regulator.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c
index c24346db8a71..88f5064e412b 100644
--- a/drivers/regulator/wm8994-regulator.c
+++ b/drivers/regulator/wm8994-regulator.c
@@ -145,10 +145,12 @@ static int wm8994_ldo_probe(struct platform_device *pdev)
config.driver_data = ldo;
config.regmap = wm8994->regmap;
config.init_data = &ldo->init_data;
- if (pdata)
+ if (pdata) {
config.ena_gpio = pdata->ldo[id].enable;
- else if (wm8994->dev->of_node)
+ } else if (wm8994->dev->of_node) {
config.ena_gpio = wm8994->pdata.ldo[id].enable;
+ config.ena_gpio_initialized = true;
+ }
/* Use default constraints if none set up */
if (!pdata || !pdata->ldo[id].init_data || wm8994->dev->of_node) {