Commit 85e05d26 authored by Kurt Kanzenbach's avatar Kurt Kanzenbach Committed by David S. Miller
Browse files

net: dsa: of: Allow ethernet-ports as encapsulating node



Due to unified Ethernet Switch Device Tree Bindings allow for ethernet-ports as
encapsulating node as well.

Signed-off-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5a18bb14
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -726,10 +726,14 @@ static int dsa_switch_parse_ports_of(struct dsa_switch *ds,
	u32 reg;

	ports = of_get_child_by_name(dn, "ports");
	if (!ports) {
		/* The second possibility is "ethernet-ports" */
		ports = of_get_child_by_name(dn, "ethernet-ports");
		if (!ports) {
			dev_err(ds->dev, "no ports child node found\n");
			return -EINVAL;
		}
	}

	for_each_available_child_of_node(ports, port) {
		err = of_property_read_u32(port, "reg", &reg);