diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2014-11-03 13:12:04 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-11-07 06:30:25 -0500 |
commit | 1de3821ace8200432993821bfda043827029de2a (patch) | |
tree | 0cbde00f92a160441e1d9928cbbc26e856d0b371 /drivers/regulator/wm8994-regulator.c | |
parent | 76f439df50aba1838e06dd01e5f20dada7473f57 (diff) |
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.c | 6 |
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) | |||
145 | config.driver_data = ldo; | 145 | config.driver_data = ldo; |
146 | config.regmap = wm8994->regmap; | 146 | config.regmap = wm8994->regmap; |
147 | config.init_data = &ldo->init_data; | 147 | config.init_data = &ldo->init_data; |
148 | if (pdata) | 148 | if (pdata) { |
149 | config.ena_gpio = pdata->ldo[id].enable; | 149 | config.ena_gpio = pdata->ldo[id].enable; |
150 | else if (wm8994->dev->of_node) | 150 | } else if (wm8994->dev->of_node) { |
151 | config.ena_gpio = wm8994->pdata.ldo[id].enable; | 151 | config.ena_gpio = wm8994->pdata.ldo[id].enable; |
152 | config.ena_gpio_initialized = true; | ||
153 | } | ||
152 | 154 | ||
153 | /* Use default constraints if none set up */ | 155 | /* Use default constraints if none set up */ |
154 | if (!pdata || !pdata->ldo[id].init_data || wm8994->dev->of_node) { | 156 | if (!pdata || !pdata->ldo[id].init_data || wm8994->dev->of_node) { |