]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
regulator: mc13xxx: Use of_get_child_by_name
authorSachin Kamat <sachin.kamat@linaro.org>
Fri, 14 Feb 2014 11:49:59 +0000 (17:19 +0530)
committerMark Brown <broonie@linaro.org>
Fri, 14 Feb 2014 21:19:27 +0000 (21:19 +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/mc13xxx-regulator-core.c

index da48592823020af8a10b025816a74aaea0226758..4498a3f0733d088f9b9b6ccea5d17330716bab18 100644 (file)
@@ -168,7 +168,7 @@ int mc13xxx_get_num_regulators_dt(struct platform_device *pdev)
        int num;
 
        of_node_get(pdev->dev.parent->of_node);
-       parent = of_find_node_by_name(pdev->dev.parent->of_node, "regulators");
+       parent = of_get_child_by_name(pdev->dev.parent->of_node, "regulators");
        if (!parent)
                return -ENODEV;
 
@@ -188,7 +188,7 @@ struct mc13xxx_regulator_init_data *mc13xxx_parse_regulators_dt(
        int i, parsed = 0;
 
        of_node_get(pdev->dev.parent->of_node);
-       parent = of_find_node_by_name(pdev->dev.parent->of_node, "regulators");
+       parent = of_get_child_by_name(pdev->dev.parent->of_node, "regulators");
        if (!parent)
                return NULL;