Skip to contentSkip to conversation

net: dsa: Fix OF fallback lookup for ports

PATCH In review Marcus Comstedt 2 participants 2 messages May 15, 2023 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: Fix OF fallback lookup for ports

The variable 'node' was already invalid, so using it for further lookup will not work.

---

 net/dsa-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/dsa-uclass.c +1 -1
index dd78e5744d..f64c68e340 100644
@@ -381,7 +381,7 @@ static int dsa_post_bind(struct udevice *dev)
 
 	node = ofnode_find_subnode(node, "ports");
 	if (!ofnode_valid(node))
-		node = ofnode_find_subnode(node, "ethernet-ports");
+		node = ofnode_find_subnode(dev_ofnode(dev), "ethernet-ports");
 	if (!ofnode_valid(node)) {
 		dev_err(dev, "ports node is missing under DSA device!\n");
 		return -EINVAL;
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines

-----Original Message-----
From: Marcus Comstedt <[email protected]>
Sent: Monday, May 15, 2023 6:44 PM
To: [email protected]
Cc: Marcus Comstedt <[email protected]>; Claudiu Manoil <[email protected]>; Joe Hershberger <[email protected]>; Ramon Fried <[email protected]>
Subject: [PATCH] net: dsa: Fix OF fallback lookup for ports

Quoted 4 lines

The variable 'node' was already invalid, so using it for further lookup will not work.

Fixes fc054d563b (net: Introduce DSA class for Ethernet switches)

Thanks. Funny the issue was caught so late. Apparently the newer 'ethernet-ports' term had a slow adoption.