[PATCH net-next v2 0/5] net: dsa: mt7530: disable regulators on teardown and setup failure

From: Haoran Wang

Date: Thu Dec 03 2026 - 01:49:05 EST


This series fixes MT7530 regulator handling: the core and io regulators
are enabled in mt7530_setup() but were left enabled when the switch is
torn down without the driver being unbound, or when a setup step fails.
It also moves the GPIO controller registration after the FDB flush and
factors out the regulator disable into a helper that is reused on the
error paths.

Changes in v2:
- Target net-next instead of net: the issues are edge cases rather than
regressions reported in the field.
- Keep the regulator_disable() error reporting in the helper (Andrew).
- Add a sw_teardown() callback symmetric with sw_setup() and use it from
mt753x_teardown() and the mt753x_setup() error path (Andrew).
- Fix the Fixes tag on the last patch: the mt753x_setup() failure paths
were added by commit ba751e28d442 ("net: dsa: mt7530: add interrupt
support").
- Add Andrew's Reviewed-by.

Haoran Wang (5):
net: dsa: mt7530: disable regulators on switch teardown
net: dsa: mt7530: factor out mt7530_disable_pwrs()
net: dsa: mt7530: register the GPIO controller last in setup
net: dsa: mt7530: disable regulators on setup failure
net: dsa: mt7530: disable regulators on mt753x_setup() failure

drivers/net/dsa/mt7530-mdio.c | 14 +-----
drivers/net/dsa/mt7530.c | 81 ++++++++++++++++++++++++++++-------
drivers/net/dsa/mt7530.h | 2 +
3 files changed, 68 insertions(+), 29 deletions(-)