regulator: act8865: Add missing of_node_put
[deliverable/linux.git] / drivers / regulator / act8865-regulator.c
index 084cc0819a52f95a24c1f6c2bed63c1f416d5532..2d2c3b004ab77dfb45a1844d33bcf29470151339 100644 (file)
@@ -213,7 +213,7 @@ static int act8865_pdata_from_dt(struct device *dev,
        struct device_node *np;
        struct act8865_regulator_data *regulator;
 
-       np = of_find_node_by_name(dev->of_node, "regulators");
+       np = of_get_child_by_name(dev->of_node, "regulators");
        if (!np) {
                dev_err(dev, "missing 'regulators' subnode in DT\n");
                return -EINVAL;
@@ -221,6 +221,7 @@ static int act8865_pdata_from_dt(struct device *dev,
 
        matched = of_regulator_match(dev, np,
                                act8865_matches, ARRAY_SIZE(act8865_matches));
+       of_node_put(np);
        if (matched <= 0)
                return matched;
 
This page took 0.024599 seconds and 5 git commands to generate.