mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
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: 86ef402d80 ("gpiolib: sanitize the return value of gpio_chip::get()")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/aZYnyl-Nf4S1U2yj@google.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
This commit is contained in:
parent
ebe7561e9b
commit
fb22bb9701
|
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user