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: Kurt Kanzenbach <kurt@linutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
5a18bb14c0
commit
85e05d263e
@@ -726,10 +726,14 @@ static int dsa_switch_parse_ports_of(struct dsa_switch *ds,
|
|||||||
u32 reg;
|
u32 reg;
|
||||||
|
|
||||||
ports = of_get_child_by_name(dn, "ports");
|
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) {
|
if (!ports) {
|
||||||
dev_err(ds->dev, "no ports child node found\n");
|
dev_err(ds->dev, "no ports child node found\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for_each_available_child_of_node(ports, port) {
|
for_each_available_child_of_node(ports, port) {
|
||||||
err = of_property_read_u32(port, "reg", ®);
|
err = of_property_read_u32(port, "reg", ®);
|
||||||
|
Reference in New Issue
Block a user