pinctrl: renesas: rza1: normalize return value of gpio_get
Subsystems (3)
PATCH 1/1 pinctrl: renesas: rza1: normalize return value of gpio_get
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.
--- drivers/pinctrl/renesas/pinctrl-rza1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/renesas/pinctrl-rza1.c +1 -1
@@ -589,7 +589,7 @@ static inline unsigned int rza1_get_bit(struct rza1_port *port, {void __iomem *mem =RZA1_ADDR (port->base, reg, port->id); -return ioread16 (mem) &BIT (bit); +return !!(ioread16 (mem) &BIT (bit)); }/**
Signature · 5 lines
2.53.0.335.g19a08e0c02-goog -- Dmitry
Quoted 3 lines · Dmitry Torokhov
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.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 26 lines · Dmitry Torokhov
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 <[email protected]>--- drivers/pinctrl/renesas/pinctrl-rza1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pinctrl/renesas/pinctrl-rza1.c +1
-2@@ -589,7 +589,7 @@ static inline unsigned int rza1_get_bit(struct rza1_port *port, {void __iomem *mem =RZA1_ADDR (port->base, reg, port->id); -return ioread16 (mem) &BIT (bit); +return !!(ioread16 (mem) &BIT (bit)); }/** -- 2.53.0.335.g19a08e0c02-goog
Quoted 3 lines
--
Dmitry
Quoted 5 lines · Dmitry Torokhov
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 <[email protected]>
I expect Geert will pick this up, else tell me & I'll queue it.
Yours,
Linus Walleij
Quoted 7 lines · Linus Walleij
Quoted 4 lines · Dmitry Torokhov
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.
Quoted 5 lines
Quoted 1 line
Signed-off-by Dmitry Torokhov <[email protected]>Reviewed-by Linus Walleij <[email protected]>I expect Geert will pick this up, else tell me & I'll queue it.
Geert, will you pick it up please?
Thanks.
Signature · 1 line
Dmitry
Geert Uytterhoeven
Reviewed-byHi Dmitry,
Quoted 8 lines · Dmitry Torokhov
Quoted 7 lines · Linus Walleij
Quoted 4 lines · Dmitry Torokhov
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.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Dmitry Torokhov <[email protected]>Reviewed-by Linus Walleij <[email protected]>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:
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 ;-)
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 -- [email protected]
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