bnx2fc: do not add shared skbs to the fcoe_rx_list
[firefly-linux-kernel-4.4.55.git] / drivers / regulator / max8907-regulator.c
index d1a77512d83e69501c2a4a3a3e8c3f09b75f7ba6..4568c15fa78dea0eafda170f64f9fc86db251faa 100644 (file)
@@ -224,11 +224,11 @@ static struct of_regulator_match max8907_matches[] = {
 
 static int max8907_regulator_parse_dt(struct platform_device *pdev)
 {
-       struct device_node *np = pdev->dev.parent->of_node;
-       struct device_node *regulators;
+       struct device_node *np, *regulators;
        int ret;
 
-       if (!pdev->dev.parent->of_node)
+       np = of_node_get(pdev->dev.parent->of_node);
+       if (!np)
                return 0;
 
        regulators = of_find_node_by_name(np, "regulators");
@@ -237,9 +237,9 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev)
                return -EINVAL;
        }
 
-       ret = of_regulator_match(pdev->dev.parent, regulators,
-                                max8907_matches,
+       ret = of_regulator_match(&pdev->dev, regulators, max8907_matches,
                                 ARRAY_SIZE(max8907_matches));
+       of_node_put(regulators);
        if (ret < 0) {
                dev_err(&pdev->dev, "Error parsing regulator init data: %d\n",
                        ret);