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

index 0c5fe6c6ac26eb22ba248c3b64bbe9c98129283b..afda8c6af72151a00065723e304cc33f733a48dc 100644 (file)
@@ -231,7 +231,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev)
        if (!np)
                return 0;
 
-       regulators = of_find_node_by_name(np, "regulators");
+       regulators = of_get_child_by_name(np, "regulators");
        if (!regulators) {
                dev_err(&pdev->dev, "regulators node not found\n");
                return -EINVAL;