Re: [PATCH v4 2/4] gpio: shared: gracefully handle no-device lookup of shared GPIOs

From: Linus Walleij

Date: Fri Oct 16 2026 - 09:11:45 EST


On Wed, Oct 14, 2026 at 11:38 AM Bartosz Golaszewski
<bartosz.golaszewski@xxxxxxxxxxxxxxxx> wrote:

> We use platform lookup tables for shared GPIOs. This mechanism needs a
> struct device to work so fwnode-based lookup with no device associated
> currently causes a NULL-pointer deference.
>
> Adding this functionality will require a larger rework and it has never
> worked anyway so add a check that allows the kernel to gracefully handle
> this situation with an error ahead of implementing that functionality as
> a new feature.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Reported-by: Abel Vesa <abelvesa@xxxxxxxxxx>
> Fixes: a060b8c511ab ("gpiolib: implement low-level, shared GPIO support")
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>

Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij