aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8925-regulator.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/max8925-regulator.c')
-rw-r--r--drivers/regulator/max8925-regulator.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c
index 446a85445553..0d5f64a805a0 100644
--- a/drivers/regulator/max8925-regulator.c
+++ b/drivers/regulator/max8925-regulator.c
@@ -252,7 +252,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev,
252{ 252{
253 struct device_node *nproot, *np; 253 struct device_node *nproot, *np;
254 int rcount; 254 int rcount;
255 nproot = pdev->dev.parent->of_node; 255 nproot = of_node_get(pdev->dev.parent->of_node);
256 if (!nproot) 256 if (!nproot)
257 return -ENODEV; 257 return -ENODEV;
258 np = of_find_node_by_name(nproot, "regulators"); 258 np = of_find_node_by_name(nproot, "regulators");
@@ -263,6 +263,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev,
263 263
264 rcount = of_regulator_match(&pdev->dev, np, 264 rcount = of_regulator_match(&pdev->dev, np,
265 &max8925_regulator_matches[ridx], 1); 265 &max8925_regulator_matches[ridx], 1);
266 of_node_put(np);
266 if (rcount < 0) 267 if (rcount < 0)
267 return -ENODEV; 268 return -ENODEV;
268 config->init_data = max8925_regulator_matches[ridx].init_data; 269 config->init_data = max8925_regulator_matches[ridx].init_data;