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

index 862cc81f822f599f390afe43b8c4da73e3011e10..5a558dad27e313de2b3ae0159fcf28d43f670ffd 100644 (file)
@@ -385,7 +385,7 @@ static struct tps6507x_board *tps6507x_parse_dt_reg_data(
                return NULL;
        }
 
-       regulators = of_find_node_by_name(np, "regulators");
+       regulators = of_get_child_by_name(np, "regulators");
        if (!regulators) {
                dev_err(&pdev->dev, "regulator node not found\n");
                return NULL;