]> asedeno.scripts.mit.edu Git - linux.git/commit
net: dsa: add dsa_to_port helper
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Mon, 16 Oct 2017 15:12:19 +0000 (11:12 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Oct 2017 11:24:33 +0000 (12:24 +0100)
commitc8652c83bc84ac8db44060ced0036de7628aa5e5
treed73285634543e8063d66da030e34a218fc76e805
parentf8b8b1cd5aadd221742b45eb0ee3c8a80abf036a
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>
drivers/net/dsa/b53/b53_common.c
drivers/net/dsa/lan9303-core.c
drivers/net/dsa/mt7530.c
drivers/net/dsa/mv88e6060.c
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/dsa/qca8k.c
include/net/dsa.h