]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: use a single switch statement for port setup
authorVivien Didelot <vivien.didelot@gmail.com>
Mon, 19 Aug 2019 20:00:48 +0000 (16:00 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Aug 2019 19:33:49 +0000 (12:33 -0700)
commit0dc0554ac0bee209ae77cbc7694cfb07621adf9b
tree976d4c5e45c6d618865918a19e7ec8851fb89519
parent17bc53d77d89f2cd1e49baec0d53a6138ef956be
net: dsa: use a single switch statement for port setup

It is currently difficult to read the different steps involved in the
setup and teardown of ports in the DSA code. Keep it simple with a
single switch statement for each port type: UNUSED, CPU, DSA, or USER.

Also no need to call devlink_port_unregister from within dsa_port_setup
as this step is inconditionally handled by dsa_port_teardown on error.

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa2.c