regulator: max77693: Use of_get_child_by_name
authorSachin Kamat <sachin.kamat@linaro.org>
Fri, 14 Feb 2014 11:49:48 +0000 (17:19 +0530)
committerMark Brown <broonie@linaro.org>
Fri, 14 Feb 2014 21:08:31 +0000 (21:08 +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/max77693.c

index 5fb899f461d0c47a666715fc6bf3813083ee17a3..057d040e6feb198e92714cf3e0eadbca363e59fd 100644 (file)
@@ -170,7 +170,7 @@ static int max77693_pmic_dt_parse_rdata(struct device *dev,
        struct max77693_regulator_data *tmp;
        int i, matched = 0;
 
-       np = of_find_node_by_name(dev->parent->of_node, "regulators");
+       np = of_get_child_by_name(dev->parent->of_node, "regulators");
        if (!np)
                return -EINVAL;