summaryrefslogtreecommitdiff
path: root/net/dsa/slave.c
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-10-16 18:12:13 +0300
committerDavid S. Miller <davem@davemloft.net>2017-10-18 14:24:33 +0300
commita5b930e0598dc46184af0282c23c75b2167d9384 (patch)
tree773939757dbc0644e6f4ede5c2a64493b1262d82 /net/dsa/slave.c
parenta2084f5650624edd0805dc78260d097df4f38eb6 (diff)
downloadlinux-a5b930e0598dc46184af0282c23c75b2167d9384.tar.xz
net: dsa: use port's cpu_dp when creating a slave
When dsa_slave_create is called, the related port already has a CPU port assigned to it, available in its cpu_dp member. Use it instead of the unique tree cpu_dp. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r--net/dsa/slave.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 45f4ea845c07..c6f4829645bf 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1117,16 +1117,13 @@ int dsa_slave_resume(struct net_device *slave_dev)
int dsa_slave_create(struct dsa_port *port, const char *name)
{
struct dsa_notifier_register_info rinfo = { };
+ struct dsa_port *cpu_dp = port->cpu_dp;
+ struct net_device *master = cpu_dp->netdev;
struct dsa_switch *ds = port->ds;
- struct net_device *master;
struct net_device *slave_dev;
struct dsa_slave_priv *p;
- struct dsa_port *cpu_dp;
int ret;
- cpu_dp = ds->dst->cpu_dp;
- master = cpu_dp->netdev;
-
if (!ds->num_tx_queues)
ds->num_tx_queues = 1;