From 3ea9389656ddf8beb1b5b52b8db6333fa4a7c00e Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Thu, 11 Apr 2013 18:36:57 +0200 Subject: regulator: wm8994: Use GPIO parsed from DT when registering regulators Ensure the regulators are registered with a GPIO parsed from the device tree when available. Signed-off-by: Sylwester Nawrocki Signed-off-by: Mark Brown --- drivers/regulator/wm8994-regulator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/regulator/wm8994-regulator.c') diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c index f03fbf1ff38a..a612c356a697 100644 --- a/drivers/regulator/wm8994-regulator.c +++ b/drivers/regulator/wm8994-regulator.c @@ -149,9 +149,11 @@ static int wm8994_ldo_probe(struct platform_device *pdev) config.init_data = &ldo->init_data; if (pdata) config.ena_gpio = pdata->ldo[id].enable; + else if (wm8994->dev->of_node) + config.ena_gpio = wm8994->pdata.ldo[id].enable; /* Use default constraints if none set up */ - if (!pdata || !pdata->ldo[id].init_data) { + if (!pdata || !pdata->ldo[id].init_data || wm8994->dev->of_node) { dev_dbg(wm8994->dev, "Using default init data, supply %s %s\n", ldo->supply.dev_name, ldo->supply.supply); -- cgit v1.2.3