Re: [PATCH net 3/5] net: dsa: mt7530: register the GPIO controller last in setup

From: Andrew Lunn

Date: Tue Nov 24 2026 - 13:38:30 EST


On Tue, Nov 24, 2026 at 04:25:57PM +0800, Haoran Wang wrote:
> mt7530_setup_gpio() publishes a GPIO controller that userspace and other
> drivers can use immediately, but it currently runs before the FDB flush,
> which is the last step of setup that can fail.
>
> Move the GPIO controller registration after the FDB flush so that the
> controller is only made visible once every fallible step, including the
> FDB flush, has succeeded. This becomes important in the next patch, where
> the failure paths disable the regulators and return an error, so the
> controller must not be registered across a failed setup.
>
> Signed-off-by: Haoran Wang <wanghr2026@xxxxxxxxxxxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew