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

index f704d83c93c4a95fc729cc48c510611d4b5cd33f..fa99bfccaa6ba6dcbebb07758c7ed1cf42c639a0 100644 (file)
@@ -322,7 +322,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev,
        nproot = of_node_get(pdev->dev.parent->of_node);
        if (!nproot)
                return -ENODEV;
-       nproot = of_find_node_by_name(nproot, "regulators");
+       nproot = of_get_child_by_name(nproot, "regulators");
        if (!nproot) {
                dev_err(&pdev->dev, "failed to find regulators node\n");
                return -ENODEV;