Re: [PATCH v2] gpio: lpc32xx: check devm_gpiochip_add_data() return value

From: Bartosz Golaszewski

Date: Fri Oct 16 2026 - 05:08:12 EST


On Thu, 15 Oct 2026 19:15:57 +0200, Jayaraj Devaraj
<jayarajdmit@xxxxxxxxx> said:
> lpc32xx_gpio_probe() registers each gpio chip with
> devm_gpiochip_add_data() but ignores the return value. If registering
> a chip fails, probe still returns 0, so the driver binds with a chip
> missing and no error is reported.
>
> Check the return value, print an error naming the failing chip and
> return the error code. Chips registered earlier in the loop are devm
> managed and are removed automatically on failure.
>
> Signed-off-by: Jayaraj Devaraj <jayarajdmit@xxxxxxxxx>
> Reviewed-by: Vladimir Zapolskiy <vz@xxxxxxxxx>
> ---

Please don't send new versions of patches in response to existing threads. They
must be new threads. Please consider using b4 for managing patches[1].

Please resend it as a new thread.

Bartosz

[1] https://b4.docs.kernel.org/en/latest/