Skip to contentSkip to conversation

regulator: ltc3589: Use of_get_child_by_name

PATCH Applied Axel Lin 2 participants 2 messages Jun 5, 2014 – Jun 16, 2014 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: ltc3589: 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.

---
 drivers/regulator/ltc3589.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/ltc3589.c +1 -1
index 110a99e..c810518 100644
@@ -255,7 +255,7 @@ static int ltc3589_parse_regulators_dt(struct ltc3589 *ltc3589)
 	struct device_node *node;
 	int i, ret;
 
-	node = of_find_node_by_name(dev->of_node, "regulators");
+	node = of_get_child_by_name(dev->of_node, "regulators");
 	if (!node) {
 		dev_err(dev, "regulators node not found\n");
 		return -EINVAL;
Signature · 1 line
1.8.3.2
maintainer Applied
#1 lore raw
Quoted 2 lines · Axel Lin

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.

Applied, thanks.