summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/b53/b53_common.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-10-18 13:24:34 +0200
committerDavid S. Miller <davem@davemloft.net>2017-10-18 13:24:34 +0200
commit1bbc728988f09e40c83585cf3322b1f6c1aa17b5 (patch)
treed73285634543e8063d66da030e34a218fc76e805 /drivers/net/dsa/b53/b53_common.c
parentnetlink: use NETLINK_CB(in_skb).sk instead of looking it up (diff)
parentnet: dsa: add dsa_to_port helper (diff)
downloadlinux-1bbc728988f09e40c83585cf3322b1f6c1aa17b5.tar.xz
linux-1bbc728988f09e40c83585cf3322b1f6c1aa17b5.zip
Merge branch 'dsa-master-and-slave-helpers'
Vivien Didelot says: ==================== net: dsa: master and slave helpers This patch series adds a few helpers to DSA core for clarity and readability but brings no functional changes. A dsa_slave_notify helper calls the DSA notifiers when (un)registering a slave device. Most of the DSA slave code only needs to access the dsa_port structure, not the dsa_slave_priv (which only contains a few PHY-specific members). Thus a dsa_slave_to_port helper returns a dsa_port structure of a slave device. A dsa_slave_to_master returns the master device of a slave device. After that the netdev member of the dsa_port structure is split into two explicit master and slave members to avoid confusion, and a dsa_to_port helper is added for switch drivers to get a const reference to a port. Changes in v2: - prefer dsa_slave_to_master instead of dsa_slave_get_master - rename dsa_master_get_slave to dsa_master_find_slave - pack master and slave net devices into an anonymous union - add dsa_to_port public helper for switch drivers - add Reviewed-by tags from Florian ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/b53/b53_common.c')
-rw-r--r--drivers/net/dsa/b53/b53_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index d4ce092def83..b48cf0487b43 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1354,7 +1354,7 @@ int b53_br_join(struct dsa_switch *ds, int port, struct net_device *br)
b53_read16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), &pvlan);
b53_for_each_port(dev, i) {
- if (ds->ports[i].bridge_dev != br)
+ if (dsa_to_port(ds, i)->bridge_dev != br)
continue;
/* Add this local port to the remote port VLAN control
@@ -1390,7 +1390,7 @@ void b53_br_leave(struct dsa_switch *ds, int port, struct net_device *br)
b53_for_each_port(dev, i) {
/* Don't touch the remaining ports */
- if (ds->ports[i].bridge_dev != br)
+ if (dsa_to_port(ds, i)->bridge_dev != br)
continue;
b53_read16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(i), &reg);