629cb324e096cb9874e73c5cb555808a40e93bed
[openwrt/staging/pepe2k.git] /
1 From 1ee0591a1093c2448642c33433483e9260275f7b Mon Sep 17 00:00:00 2001
2 From: Ansuel Smith <ansuelsmth@gmail.com>
3 Date: Fri, 14 May 2021 23:00:05 +0200
4 Subject: [PATCH] net: dsa: qca8k: add ethernet-ports fallback to
5 setup_mdio_bus
6
7 Dsa now also supports ethernet-ports. Add this new binding as a fallback
8 if the ports node can't be found.
9
10 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
11 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
12 Signed-off-by: David S. Miller <davem@davemloft.net>
13 ---
14 drivers/net/dsa/qca8k.c | 3 +++
15 1 file changed, 3 insertions(+)
16
17 --- a/drivers/net/dsa/qca8k.c
18 +++ b/drivers/net/dsa/qca8k.c
19 @@ -719,6 +719,9 @@ qca8k_setup_mdio_bus(struct qca8k_priv *
20
21 ports = of_get_child_by_name(priv->dev->of_node, "ports");
22 if (!ports)
23 + ports = of_get_child_by_name(priv->dev->of_node, "ethernet-ports");
24 +
25 + if (!ports)
26 return -EINVAL;
27
28 for_each_available_child_of_node(ports, port) {