Skip to contentSkip to conversation

regulator: AXP20x: fix wrong call to of_find_node_by_name

PATCH New Boris BREZILLON 3 participants 3 messages May 19, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: AXP20x: fix wrong call to of_find_node_by_name

The of_find_node_by_name function will search for a DT node named "regulators" after the provided np node, but will not ensure that this node is a child of np.
This might result in retrieving a "regulators" node that is not related to the axp20x PMIC.

---
 drivers/regulator/axp20x-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/axp20x-regulator.c +1 -1
index 78a29e6..61ae4d4 100644
@@ -188,7 +188,7 @@ static int axp20x_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_warn(&pdev->dev, "regulators node not found\n");
 	} else {
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/1 regulator: AXP20x: fix wrong call to of_find_node_by_name

Quoted 8 lines · Boris BREZILLON

The of_find_node_by_name function will search for a DT node named "regulators" after the provided np node, but will not ensure that this node is a child of np.
This might result in retrieving a "regulators" node that is not related to the axp20x PMIC.

---

Thank you,

Signature · 1 line
Carlo Caione
maintainer
#2 lore raw

PATCH 1/1 regulator: AXP20x: fix wrong call to of_find_node_by_name

In reply to Boris BREZILLON
Quoted 5 lines · Boris BREZILLON

The of_find_node_by_name function will search for a DT node named "regulators" after the provided np node, but will not ensure that this node is a child of np.
This might result in retrieving a "regulators" node that is not related to the axp20x PMIC.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140519/cbfc57cd/attachment.sig>