net: dsa: use dsa_to_port helper everywhere
authorVivien Didelot <vivien.didelot@gmail.com>
Mon, 21 Oct 2019 20:51:15 +0000 (16:51 -0400)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 22 Oct 2019 19:37:06 +0000 (12:37 -0700)
commit68bb8ea8ad0d497c28ed47423246b1ab20f26976
tree8e7c4ca7da4bf3171ca335d0c85d752d6f3d66b9
parent88652bf8ce4b91c49769a2a49c17dc44b85b4fa2
net: dsa: use dsa_to_port helper everywhere

Do not let the drivers access the ds->ports static array directly
while there is a dsa_to_port helper for this purpose.

At the same time, un-const this helper since the SJA1105 driver
assigns the priv member of the returned dsa_port structure.

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
12 files changed:
drivers/net/dsa/b53/b53_common.c
drivers/net/dsa/bcm_sf2.c
drivers/net/dsa/bcm_sf2_cfp.c
drivers/net/dsa/mt7530.c
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/dsa/qca8k.c
drivers/net/dsa/sja1105/sja1105_main.c
include/net/dsa.h
net/dsa/dsa.c
net/dsa/dsa2.c
net/dsa/switch.c
net/dsa/tag_8021q.c