regulator: act8865: Use of_get_child_by_name
authorSachin Kamat <sachin.kamat@linaro.org>
Fri, 14 Feb 2014 11:49:54 +0000 (17:19 +0530)
committerMark Brown <broonie@linaro.org>
Fri, 14 Feb 2014 21:14:36 +0000 (21:14 +0000)
of_find_node_by_name walks the allnodes list, and can thus walk
outside of the parent node. Use of_get_child_by_name instead.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/act8865-regulator.c

index 084cc0819a52f95a24c1f6c2bed63c1f416d5532..c9f98b06130750f49adeef14768184b456385a13 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;