From 1de3821ace8200432993821bfda043827029de2a Mon Sep 17 00:00:00 2001 From: Markus Pargmann Date: Mon, 3 Nov 2014 19:12:04 +0100 Subject: 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 Signed-off-by: Mark Brown --- drivers/regulator/gpio-regulator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/regulator/gpio-regulator.c') diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c index 989b23b377c0..5da0125fac6a 100644 --- a/drivers/regulator/gpio-regulator.c +++ b/drivers/regulator/gpio-regulator.c @@ -322,8 +322,10 @@ static int gpio_regulator_probe(struct platform_device *pdev) cfg.driver_data = drvdata; cfg.of_node = np; - if (config->enable_gpio >= 0) + if (config->enable_gpio >= 0) { cfg.ena_gpio = config->enable_gpio; + cfg.ena_gpio_initialized = true; + } cfg.ena_gpio_invert = !config->enable_high; if (config->enabled_at_boot) { if (config->enable_high) -- cgit v1.2.3