summaryrefslogtreecommitdiff
path: root/net/dsa/dsa2.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-07-22 16:56:44 -0700
committerDavid S. Miller <davem@davemloft.net>2020-07-22 16:56:44 -0700
commit09a0d326b977dbcae393d702a4dadd09fcbd06c7 (patch)
tree4fdd3c747a9f2b6db6c54d9afdc058cd16267599 /net/dsa/dsa2.c
parent8bb849d67f44b1a1280cda900ea02fdbc36d4363 (diff)
parent85e05d263ed2d50e3be86c73175effe780ec1d9a (diff)
Merge branch 'Add-DSA-yaml-binding'
Kurt Kanzenbach says: ==================== Add DSA yaml binding as discussed [1] [2] it makes sense to add a DSA yaml binding. This is the second version and contains now two ways of specifying the switch ports: Either by "ports" or by "ethernet-ports". That is why the third patch also adjusts the DSA core for it. Tested in combination with the hellcreek.yaml file. Changes since v1: * Use select to not match unrelated switches * Allow ethernet-port(s) * List ethernet-controller properties * Include better description * Let dsa.txt refer to dsa.yaml Thanks, Kurt [1] - https://lkml.kernel.org/netdev/449f0a03-a91d-ae82-b31f-59dfd1457ec5@gmail.com/ [2] - https://lkml.kernel.org/netdev/20200710090618.28945-1-kurt@linutronix.de/ ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa2.c')
-rw-r--r--net/dsa/dsa2.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index e055efff390bf..c0ffc7a2b65f8 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -727,8 +727,12 @@ static int dsa_switch_parse_ports_of(struct dsa_switch *ds,
ports = of_get_child_by_name(dn, "ports");
if (!ports) {
- dev_err(ds->dev, "no ports child node found\n");
- return -EINVAL;
+ /* 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) {