summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/fixed.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/fixed.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/fixed.c')
-rw-r--r--drivers/regulator/fixed.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 354105eff1f8..17f6a7d331f8 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -157,8 +157,11 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
drvdata->desc.fixed_uV = config->microvolts;
- if (config->gpio >= 0)
+ if (config->gpio >= 0) {
cfg.ena_gpio = config->gpio;
+ if (pdev->dev.of_node)
+ cfg.ena_gpio_initialized = true;
+ }
cfg.ena_gpio_invert = !config->enable_high;
if (config->enabled_at_boot) {
if (config->enable_high)