summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6060.c
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-10-16 11:12:19 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-18 12:24:33 +0100
commitc8652c83bc84ac8db44060ced0036de7628aa5e5 (patch)
treed73285634543e8063d66da030e34a218fc76e805 /drivers/net/dsa/mv88e6060.c
parentf8b8b1cd5aadd221742b45eb0ee3c8a80abf036a (diff)
net: dsa: add dsa_to_port helper
The dsa_port structure is part of DSA core data and must only be updated by the later. It is OK and sometimes necessary for the DSA drivers to access this data, but this has to be read only. For that purpose, add a dsa_to_port() helper which returns a const pointer to a dsa_port structure which must be used by DSA drivers from now on instead of digging into ds->ports[] themselves. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6060.c')
-rw-r--r--drivers/net/dsa/mv88e6060.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6060.c b/drivers/net/dsa/mv88e6060.c
index 6173be889d95..f78b9e13be1c 100644
--- a/drivers/net/dsa/mv88e6060.c
+++ b/drivers/net/dsa/mv88e6060.c
@@ -177,7 +177,7 @@ static int mv88e6060_setup_port(struct dsa_switch *ds, int p)
((p & 0xf) << PORT_VLAN_MAP_DBNUM_SHIFT) |
(dsa_is_cpu_port(ds, p) ?
ds->enabled_port_mask :
- BIT(ds->ports[p].cpu_dp->index)));
+ BIT(dsa_to_port(ds, p)->cpu_dp->index)));
/* Port Association Vector: when learning source addresses
* of packets, add the address to the address database using