Merge tag 'sh-pinmux' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[cascardo/linux.git] / drivers / regulator / 88pm8607.c
index a957e8c..c79ab84 100644 (file)
@@ -347,7 +347,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev,
                                    struct regulator_config *config)
 {
        struct device_node *nproot, *np;
-       nproot = pdev->dev.parent->of_node;
+       nproot = of_node_get(pdev->dev.parent->of_node);
        if (!nproot)
                return -ENODEV;
        nproot = of_find_node_by_name(nproot, "regulators");
@@ -363,6 +363,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev,
                        break;
                }
        }
+       of_node_put(nproot);
        return 0;
 }
 #else