[PATCH] net: dsa: Fix OF fallback lookup for ports

Marcus Comstedt marcus.comstedt at requtech.se
Mon May 15 17:44:23 CEST 2023


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

Signed-off-by: Marcus Comstedt <marcus.comstedt at requtech.se>
---

 net/dsa-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dsa-uclass.c b/net/dsa-uclass.c
index dd78e5744d..f64c68e340 100644
--- a/net/dsa-uclass.c
+++ b/net/dsa-uclass.c
@@ -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;
-- 
2.39.2


More information about the U-Boot mailing list