]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: tag_8021q: absorb dsa_8021q_setup into dsa_tag_8021q_{,un}register
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 19 Jul 2021 17:14:50 +0000 (20:14 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Jul 2021 13:36:42 +0000 (06:36 -0700)
commitbf2af11a1417215b86f2f20d5c0d04ff5062c36e
tree120defbf9450e0cf388ecdeae9b9bc37087ae47f
parentcf6888a35a43c6ba0fa40304a07ba29abe089e58
net: dsa: tag_8021q: absorb dsa_8021q_setup into dsa_tag_8021q_{,un}register

Right now, setting up tag_8021q is a 2-step operation for a driver,
first the context structure needs to be created, then the VLANs need to
be installed on the ports. A similar thing is true for teardown.

Merge the 2 steps into the register/unregister methods, to be as
transparent as possible for the driver as to what tag_8021q does behind
the scenes. This also gets rid of the funny "bool setup == true means
setup, == false means teardown" API that tag_8021q used to expose.

Note that dsa_tag_8021q_register() must be called at least in the
.setup() driver method and never earlier (like in the driver probe
function). This is because the DSA switch tree is not initialized at
probe time, and the cross-chip notifiers will not work.

For symmetry with .setup(), the unregister method should be put in
.teardown().

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/ocelot/felix.c
drivers/net/dsa/sja1105/sja1105_main.c
include/linux/dsa/8021q.h
net/dsa/tag_8021q.c