[PATCH v2] gpio: lpc32xx: check devm_gpiochip_add_data() return value
Bartosz Golaszewski
brgl at kernel.org
Fri Oct 16 01:59:49 PDT 2026
On Thu, 15 Oct 2026 19:15:57 +0200, Jayaraj Devaraj
<jayarajdmit at gmail.com> 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 at gmail.com>
> Reviewed-by: Vladimir Zapolskiy <vz at mleia.com>
> ---
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/
More information about the linux-arm-kernel
mailing list