]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: dsa: Fix OF fallback lookup for ports
authorMarcus Comstedt <marcus.comstedt@requtech.se>
Mon, 15 May 2023 15:44:23 +0000 (15:44 +0000)
committerPeng Fan <peng.fan@nxp.com>
Wed, 14 Jun 2023 10:38:25 +0000 (18:38 +0800)
The variable 'node' was already invalid, so using it for further
lookup will not work.

Signed-off-by: Marcus Comstedt <marcus.comstedt@requtech.se>
Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
net/dsa-uclass.c

index dd78e5744d58cff973a36e778320dd122566aef2..f64c68e340dc075a124f036ec6e01fde6c386df0 100644 (file)
@@ -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;