net: dsa: qca8k: add ethernet-ports fallback to setup_mdio_bus
authorAnsuel Smith <ansuelsmth@gmail.com>
Fri, 14 May 2021 21:00:05 +0000 (23:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 May 2021 22:30:22 +0000 (15:30 -0700)
Dsa now also supports ethernet-ports. Add this new binding as a fallback
if the ports node can't be found.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/qca8k.c

index 35ff4cf..cc9ab35 100644 (file)
@@ -719,6 +719,9 @@ qca8k_setup_mdio_bus(struct qca8k_priv *priv)
 
        ports = of_get_child_by_name(priv->dev->of_node, "ports");
        if (!ports)
+               ports = of_get_child_by_name(priv->dev->of_node, "ethernet-ports");
+
+       if (!ports)
                return -EINVAL;
 
        for_each_available_child_of_node(ports, port) {