diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2017-06-13 13:27:19 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-13 16:35:02 -0400 |
commit | 6d3c8c0dd88a5ffc7e3695997641e4b6d4c11065 (patch) | |
tree | 847ec56e33c25db7042393473557a1cebfeb3788 /net/dsa/dsa_priv.h | |
parent | 38b6ec5008bb7019a705b576df345509f39d3f4b (diff) | |
download | linux-6d3c8c0dd88a5ffc7e3695997641e4b6d4c11065.tar.gz linux-6d3c8c0dd88a5ffc7e3695997641e4b6d4c11065.tar.bz2 linux-6d3c8c0dd88a5ffc7e3695997641e4b6d4c11065.zip |
net: dsa: Remove master_netdev and use dst->cpu_dp->netdev
In preparation for supporting multiple CPU ports, remove
dst->master_netdev and ds->master_netdev and replace them with only one
instance of the common object we have for a port: struct
dsa_port::netdev. ds->master_netdev is currently write only and would be
helpful in the case where we have two switches, both with CPU ports, and
also connected within each other, which the multi-CPU port patch series
would address.
While at it, introduce a helper function used in net/dsa/slave.c to
immediately get a reference on the master network device called
dsa_master_netdev().
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa_priv.h')
-rw-r--r-- | net/dsa/dsa_priv.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h index 66ee248796c8..5c510f4ba0ce 100644 --- a/net/dsa/dsa_priv.h +++ b/net/dsa/dsa_priv.h @@ -183,4 +183,9 @@ extern const struct dsa_device_ops qca_netdev_ops; /* tag_trailer.c */ extern const struct dsa_device_ops trailer_netdev_ops; +static inline struct net_device *dsa_master_netdev(struct dsa_slave_priv *p) +{ + return p->dp->ds->dst->cpu_dp->netdev; +} + #endif |