Re: [PATCH v2] gpio: htc-egpio: use managed gpiochip registration

From: Bartosz Golaszewski

Date: Tue Jun 23 2026 - 03:56:37 EST


On Mon, 22 Jun 2026 17:32:04 +0200, Pengpeng Hou <pengpeng@xxxxxxxxxxx> said:
> egpio_probe() registers each nested gpio_chip with gpiochip_add_data()
> but ignores the return value. If one registration fails, probe still
> returns success even though one of the chips was not published to gpiolib.
>
> Use devm_gpiochip_add_data() and fail probe if any chip registration
> fails. This lets devres unwind already registered chips and prevents the
> driver from publishing a partially initialized device.
>
> Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
> ---

Please also add the Fixes tag, it's a bug to not check the return value.

Bart