diff options
Diffstat (limited to 'drivers/regulator/max8997.c')
-rw-r--r-- | drivers/regulator/max8997.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 836908c..5abd0d32 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c @@ -960,7 +960,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, struct max8997_regulator_data *rdata; unsigned int i, dvs_voltage_nr = 1, ret; - pmic_np = iodev->dev->of_node; + pmic_np = of_node_get(iodev->dev->of_node); if (!pmic_np) { dev_err(&pdev->dev, "could not find pmic sub-node\n"); return -ENODEV; @@ -980,6 +980,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata) * pdata->num_regulators, GFP_KERNEL); if (!rdata) { + of_node_put(regulators_np); dev_err(&pdev->dev, "could not allocate memory for regulator data\n"); return -ENOMEM; } @@ -1002,6 +1003,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, rdata->reg_node = reg_np; rdata++; } + of_node_put(regulators_np); if (of_get_property(pmic_np, "max8997,pmic-buck1-uses-gpio-dvs", NULL)) pdata->buck1_gpiodvs = true; |