summaryrefslogtreecommitdiff
path: root/net/dsa/dsa_priv.h
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-10-16 18:12:18 +0300
committerDavid S. Miller <davem@davemloft.net>2017-10-18 14:24:33 +0300
commitf8b8b1cd5aadd221742b45eb0ee3c8a80abf036a (patch)
treead5b305182f3406c9de65031dce9577abd743da6 /net/dsa/dsa_priv.h
parent2231c43b560403675217f52204b18c1c59c0ee76 (diff)
downloadlinux-f8b8b1cd5aadd221742b45eb0ee3c8a80abf036a.tar.xz
net: dsa: split dsa_port's netdev member
The dsa_port structure has a "netdev" member, which can be used for either the master device, or the slave device, depending on its type. It is true that today, CPU port are not exposed to userspace, thus the port's netdev member can be used to point to its master interface. But it is still slightly confusing, so split it into more explicit "master" and "slave" members inside an anonymous union. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.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.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h
index 623c22b75e81..1e9914062d0b 100644
--- a/net/dsa/dsa_priv.h
+++ b/net/dsa/dsa_priv.h
@@ -130,7 +130,7 @@ static inline struct net_device *dsa_master_find_slave(struct net_device *dev,
if (port < 0 || port >= ds->num_ports)
return NULL;
- return ds->ports[port].netdev;
+ return ds->ports[port].slave;
}
/* port.c */
@@ -181,7 +181,7 @@ dsa_slave_to_master(const struct net_device *dev)
{
struct dsa_port *dp = dsa_slave_to_port(dev);
- return dp->cpu_dp->netdev;
+ return dp->cpu_dp->master;
}
/* switch.c */