From: Sachin Kamat Date: Fri, 14 Feb 2014 11:49:48 +0000 (+0530) Subject: regulator: max77693: Use of_get_child_by_name X-Git-Tag: firefly_0821_release~176^2~4202^2~3^4~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4fa43a4a6f8d1b7a8f32e7ba654f36ef86ab1e56;p=firefly-linux-kernel-4.4.55.git regulator: max77693: 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/max77693.c b/drivers/regulator/max77693.c index 5fb899f461d0..057d040e6feb 100644 --- a/drivers/regulator/max77693.c +++ b/drivers/regulator/max77693.c @@ -170,7 +170,7 @@ static int max77693_pmic_dt_parse_rdata(struct device *dev, struct max77693_regulator_data *tmp; int i, matched = 0; - np = of_find_node_by_name(dev->parent->of_node, "regulators"); + np = of_get_child_by_name(dev->parent->of_node, "regulators"); if (!np) return -EINVAL;