Skip to content

Commit

Permalink
regulator: wm8994: Use GPIO parsed from DT when registering regulators
Browse files Browse the repository at this point in the history
Ensure the regulators are registered with a GPIO parsed from the device
tree when available.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Sylwester Nawrocki authored and Mark Brown committed Apr 11, 2013
1 parent e3d2777 commit 3ea9389
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/regulator/wm8994-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 3ea9389

Please sign in to comment.