summaryrefslogtreecommitdiffstats
path: root/net/dsa/dsa2.c
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@gmail.com>2019-10-31 03:09:15 +0100
committerDavid S. Miller <davem@davemloft.net>2019-10-31 22:26:38 +0100
commit3774ecdb8ca201af770288d57997dbf6445eb3c8 (patch)
tree409832eab99445f21911219ce22d19058040db91 /net/dsa/dsa2.c
parentnet: dsa: remove ds->rtable (diff)
downloadlinux-3774ecdb8ca201af770288d57997dbf6445eb3c8.tar.xz
linux-3774ecdb8ca201af770288d57997dbf6445eb3c8.zip
net: dsa: remove switch routing table setup code
The dsa_switch structure has no routing table specific data to setup, so the switch fabric can directly walk its ports and initialize its routing table from them. This allows us to remove the dsa_switch_setup_routing_table function. Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/dsa/dsa2.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index efd7453f308e..a887231fff13 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -176,14 +176,13 @@ static bool dsa_port_setup_routing_table(struct dsa_port *dp)
return true;
}
-static bool dsa_switch_setup_routing_table(struct dsa_switch *ds)
+static bool dsa_tree_setup_routing_table(struct dsa_switch_tree *dst)
{
- struct dsa_switch_tree *dst = ds->dst;
bool complete = true;
struct dsa_port *dp;
list_for_each_entry(dp, &dst->ports, list) {
- if (dp->ds == ds && dsa_port_is_dsa(dp)) {
+ if (dsa_port_is_dsa(dp)) {
complete = dsa_port_setup_routing_table(dp);
if (!complete)
break;
@@ -193,25 +192,6 @@ static bool dsa_switch_setup_routing_table(struct dsa_switch *ds)
return complete;
}
-static bool dsa_tree_setup_routing_table(struct dsa_switch_tree *dst)
-{
- struct dsa_switch *ds;
- bool complete = true;
- int device;
-
- for (device = 0; device < DSA_MAX_SWITCHES; device++) {
- ds = dst->ds[device];
- if (!ds)
- continue;
-
- complete = dsa_switch_setup_routing_table(ds);
- if (!complete)
- break;
- }
-
- return complete;
-}
-
static struct dsa_port *dsa_tree_find_first_cpu(struct dsa_switch_tree *dst)
{
struct dsa_port *dp;