]> git.ipfire.org Git - thirdparty/linux.git/commit
net: dsa: lantiq_gswip: fix order in .remove operation
authorDaniel Golle <daniel@makrotopia.org>
Tue, 9 Dec 2025 01:28:20 +0000 (01:28 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 18 Dec 2025 11:53:21 +0000 (12:53 +0100)
commit377d66fa86654085be1f48906c1d88b7ca721c78
tree533020d17bc4ff4f852879ee211c1f9cfbfb39f6
parent7b07be1ff1cb6c49869910518650e8d0abc7d25f
net: dsa: lantiq_gswip: fix order in .remove operation

Russell King pointed out that disabling the switch by clearing
GSWIP_MDIO_GLOB_ENABLE before calling dsa_unregister_switch() is
problematic, as it violates a Golden Rule of driver development to
always first unpublish userspace interfaces and then disable the
hardware.

Fix this, and also simplify the probe() function, by introducing a
dsa_switch_ops teardown() operation which takes care of clearing the
GSWIP_MDIO_GLOB_ENABLE bit.

Fixes: 14fceff4771e5 ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
Suggested-by: "Russell King (Oracle)" <linux@armlinux.org.uk>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://patch.msgid.link/4ebd72a29edc1e4059b9666a26a0bb5d906a829a.1765241054.git.daniel@makrotopia.org
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/dsa/lantiq/lantiq_gswip.c
drivers/net/dsa/lantiq/lantiq_gswip_common.c