net: dsa: do not enable or disable non user ports
authorVivien Didelot <vivien.didelot@gmail.com>
Mon, 19 Aug 2019 20:00:49 +0000 (16:00 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Aug 2019 19:33:49 +0000 (12:33 -0700)
commit74be4babe72fd1ed1bba6b52d0bdc0d1e13f7af8
tree1e0bf529fdcd8013cc0c88fcd214002e0587ca04
parent955222ca5281ee7ded6b899605c055b147a15c73
net: dsa: do not enable or disable non user ports

The .port_enable and .port_disable operations are currently only
called for user ports, hence assuming they have a slave device. In
preparation for using these operations for other port types as well,
simply guard all implementations against non user ports and return
directly in such case.

Note that bcm_sf2_sw_suspend() currently calls bcm_sf2_port_disable()
(and thus b53_disable_port()) against the user and CPU ports, so do
not guards those functions. They will be called for unused ports in
the future, but that was expected by those drivers anyway.

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/b53/b53_common.c
drivers/net/dsa/bcm_sf2.c
drivers/net/dsa/lan9303-core.c
drivers/net/dsa/lantiq_gswip.c
drivers/net/dsa/microchip/ksz_common.c
drivers/net/dsa/mt7530.c
drivers/net/dsa/mv88e6xxx/chip.c