Re: [PATCH] pinctrl: renesas: rza1: normalize return value of gpio_get

From: Geert Uytterhoeven

Date: Tue Mar 10 2026 - 04:22:15 EST


Hi Dmitry,

On Tue, 10 Mar 2026 at 07:16, Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> wrote:
> On Tue, Feb 24, 2026 at 10:04:15AM +0100, Linus Walleij wrote:
> > On Wed, Feb 18, 2026 at 9:58 PM Dmitry Torokhov
> > <dmitry.torokhov@xxxxxxxxx> wrote:
> >
> > > The GPIO get callback is expected to return 0 or 1 (or a negative error
> > > code). Ensure that the value returned by rza1_gpio_get() is normalized
> > > to the [0, 1] range.
> > >
> > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
> >
> > Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>
> >
> > I expect Geert will pick this up, else tell me & I'll queue it.
>
> Geert, will you pick it up please?

Sorry, I am seriously running behind with patch review. I hadn't
realized this is a serious issue, but apparently the 0/1 behavior is
enforced since commit 86ef402d805d606a ("gpiolib: sanitize the return
value of gpio_chip::get()"), thus rendering the RZ/A1 GPIO driver
broken since v6.15-rc1. Unfortunately this doesn't show up in my
limited boot testing of RSK+RZA1 :-(

So:
Fixes: 86ef402d805d606a ("gpiolib: sanitize the return value of
gpio_chip::get()")

Oh, that got relaxed again in commit ec2cceadfae72304 ("gpiolib:
normalize the return value of gc->get() on behalf of buggy drivers")
in v7.0-rc3, so apparently we're not the only ones...

BTW, that's all info I would have liked to see before ;-)

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
i.e. will queue in renesas-pinctrl-fixes for v7.0.

Gr{oetje,eeting}s,

Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds