net: ti: am65-cpsw-nuss: Ignore disabled ethernet ports
authorSiddharth Vadapalli <s-vadapalli@ti.com>
Fri, 21 Nov 2025 13:21:53 +0000 (18:51 +0530)
committerTom Rini <trini@konsulko.com>
Thu, 27 Nov 2025 15:27:03 +0000 (09:27 -0600)
Currently, the bind callback of the driver namely am65_cpsw_nuss_bind()
registers all ethernet ports including the ones that have been disabled
in the device-tree. Since the ports that have been disabled are ought to
be ignored, fix the implementation to register only the enabled ports as
indicated by their 'status' in their respective device-tree node.

Fixes: 3943531a5468 ("net: ti: am65-cpsw-nuss: Define bind method for CPSW driver")
Reported-by: Wadim Egorov <w.egorov@phytec.de>
Closes: https://patch.msgid.link/8b4ac072-125c-493b-b12a-f0a4e9d56e7e@phytec.de
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
drivers/net/ti/am65-cpsw-nuss.c

index 7a88f76..84a3e44 100644 (file)
@@ -819,6 +819,10 @@ static int am65_cpsw_nuss_bind(struct udevice *dev)
        ofnode_for_each_subnode(node, ports_np) {
                const char *node_name;
 
+               /* Ignore disabled ports */
+               if (!ofnode_is_enabled(node))
+                       continue;
+
                node_name = ofnode_get_name(node);
 
                ret = device_bind_driver_to_node(dev, "am65_cpsw_nuss_port", node_name, node,