Re: [PATCH net] net: dsa: ks8995: Fix some error handling path in ks8995_probe()

From: Andrew Lunn
Date: Sat Aug 30 2025 - 15:24:35 EST


On Sat, Aug 30, 2025 at 07:13:59PM +0200, Christophe JAILLET wrote:
> If an error occurs after calling gpiod_set_value_cansleep(..., 0), it must
> be undone by a corresponding gpiod_set_value_cansleep(..., 1) call as
> already done in the remove function.
>
> In order to easily do the needed clean-up in the probe, add a new
> devm_add_action_or_reset() call and simplify the remove function
> accordingly.
>
> Fixes: cd6f288cbaab ("net: phy: spi_ks8995: add support for resetting switch using GPIO")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew