Re: [PATCH v2] gpiolib: normalize the return value of gc->get() on behalf of buggy drivers

From: Linus Walleij

Date: Thu Feb 19 2026 - 12:32:52 EST


On Thu, Feb 19, 2026 at 10:51 AM Bartosz Golaszewski
<bartosz.golaszewski@xxxxxxxxxxxxxxxx> wrote:

> Commit 86ef402d805d ("gpiolib: sanitize the return value of
> gpio_chip::get()") started checking the return value of the .get()
> callback in struct gpio_chip. Now - almost a year later - it turns out
> that there are quite a few drivers in tree that can break with this
> change. Partially revert it: normalize the return value in GPIO core but
> also emit a warning.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 86ef402d805d ("gpiolib: sanitize the return value of gpio_chip::get()")
> Reported-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
> Closes: https://lore.kernel.org/all/aZSkqGTqMp_57qC7@xxxxxxxxxx/
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>

Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij