Skip to content

Commit fb22bb9

Browse files
dtorgeertu
authored andcommitted
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. Fixes: 86ef402 ("gpiolib: sanitize the return value of gpio_chip::get()") Signed-off-by: Dmitry Torokhov <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent ebe7561 commit fb22bb9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/pinctrl/renesas/pinctrl-rza1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ static inline unsigned int rza1_get_bit(struct rza1_port *port,
589589
{
590590
void __iomem *mem = RZA1_ADDR(port->base, reg, port->id);
591591

592-
return ioread16(mem) & BIT(bit);
592+
return !!(ioread16(mem) & BIT(bit));
593593
}
594594

595595
/**

0 commit comments

Comments
 (0)