We may have to pass a port's dedicated CPU port to port-wide functions
such as dsa_port_mdb_add, e.g. when offloading bridge device's MDB.

The DSA port-wide functions currently take a non-const struct dsa_port *
as first argument so we cannot make cpu_dp const yet, even though it'd
be more correct. Revert this patch and make cpu_dp non-const again.

This reverts commit 24a9332a58b7f41a0d36c35a2c6897242bffdbc0.
---
 include/net/dsa.h | 2 +-
 net/dsa/slave.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/dsa.h b/include/net/dsa.h
index 6c239257309b..35b5dee7bb23 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -190,7 +190,7 @@ struct dsa_port {
        struct dsa_switch       *ds;
        unsigned int            index;
        const char              *name;
-       const struct dsa_port   *cpu_dp;
+       struct dsa_port         *cpu_dp;
        struct device_node      *dn;
        unsigned int            ageing_time;
        u8                      stp_state;
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index cc7fe47dd4bf..814ced75a0cc 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1147,7 +1147,7 @@ static void dsa_slave_notify(struct net_device *dev, 
unsigned long val)
 
 int dsa_slave_create(struct dsa_port *port)
 {
-       const struct dsa_port *cpu_dp = port->cpu_dp;
+       struct dsa_port *cpu_dp = port->cpu_dp;
        struct net_device *master = cpu_dp->master;
        struct dsa_switch *ds = port->ds;
        const char *name = port->name;
-- 
2.15.0

Reply via email to