From: Sachin Kamat Date: Fri, 14 Feb 2014 11:50:01 +0000 (+0530) Subject: regulator: tps6507x: Use of_get_child_by_name X-Git-Tag: firefly_0821_release~176^2~4202^2~1^7~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e3d4edfd98018a5bc0aa01167b7a6dcf92af7918;p=firefly-linux-kernel-4.4.55.git regulator: tps6507x: Use of_get_child_by_name 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 Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c index 862cc81f822f..5a558dad27e3 100644 --- a/drivers/regulator/tps6507x-regulator.c +++ b/drivers/regulator/tps6507x-regulator.c @@ -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;