]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: dsa: remove port masks
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Thu, 26 Oct 2017 15:22:59 +0000 (11:22 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Oct 2017 15:00:09 +0000 (00:00 +0900)
Now that DSA core provides port types, there is no need to keep this
information at the switch level. This is a static information that is
part of a DSA core dsa_port structure. Remove them.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dsa.h
net/dsa/dsa2.c
net/dsa/legacy.c

index 07dfbd7f4fd521cfecfcb604172a563bee86d676..50e276dc4c013bf9ab7b98adbde62bf7626a582d 100644 (file)
@@ -240,9 +240,6 @@ struct dsa_switch {
        /*
         * Slave mii_bus and devices for the individual ports.
         */
-       u32                     dsa_port_mask;
-       u32                     cpu_port_mask;
-       u32                     enabled_port_mask;
        u32                     phys_mii_mask;
        struct mii_bus          *slave_mii_bus;
 
index dd6f35b929372ddbfd862d90cf463b8093f1ebe7..ec58654a71cdff830ea005563c9150954ae303c4 100644 (file)
@@ -184,7 +184,6 @@ static int dsa_ds_complete(struct dsa_switch_tree *dst, struct dsa_switch *ds)
                if (err != 0)
                        return err;
 
-               ds->dsa_port_mask |= BIT(index);
                port->type = DSA_PORT_TYPE_DSA;
        }
 
@@ -500,11 +499,6 @@ static int dsa_cpu_parse(struct dsa_port *port, u32 index,
                dst->cpu_dp->master = ethernet_dev;
        }
 
-       /* Initialize cpu_port_mask now for drv->setup()
-        * to have access to a correct value, just like what
-        * net/dsa/dsa.c::dsa_switch_setup_one does.
-        */
-       ds->cpu_port_mask |= BIT(index);
        port->type = DSA_PORT_TYPE_CPU;
 
        tag_protocol = ds->ops->get_tag_protocol(ds);
@@ -540,11 +534,6 @@ static int dsa_ds_parse(struct dsa_switch_tree *dst, struct dsa_switch *ds)
                        if (err)
                                return err;
                } else {
-                       /* Initialize enabled_port_mask now for drv->setup()
-                        * to have access to a correct value, just like what
-                        * net/dsa/dsa.c::dsa_switch_setup_one does.
-                        */
-                       ds->enabled_port_mask |= BIT(index);
                        port->type = DSA_PORT_TYPE_USER;
                }
 
index 9fd5b3adab1e7f2657f42028eed52fe498699b29..93e1b116ef83b5eb71ff30e20b1b7c74212857ab 100644 (file)
@@ -124,13 +124,10 @@ static int dsa_switch_setup_one(struct dsa_switch *ds,
                        }
                        dst->cpu_dp = &ds->ports[i];
                        dst->cpu_dp->master = master;
-                       ds->cpu_port_mask |= 1 << i;
                        dp->type = DSA_PORT_TYPE_CPU;
                } else if (!strcmp(name, "dsa")) {
-                       ds->dsa_port_mask |= 1 << i;
                        dp->type = DSA_PORT_TYPE_DSA;
                } else {
-                       ds->enabled_port_mask |= 1 << i;
                        dp->type = DSA_PORT_TYPE_USER;
                }
                valid_name_found = true;