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

From: Dmitry Torokhov

Date: Wed Feb 18 2026 - 15:59:14 EST


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>
---
drivers/pinctrl/renesas/pinctrl-rza1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c b/drivers/pinctrl/renesas/pinctrl-rza1.c
index 3cfa4c8be80e..d83c7d8ee82c 100644
--- a/drivers/pinctrl/renesas/pinctrl-rza1.c
+++ b/drivers/pinctrl/renesas/pinctrl-rza1.c
@@ -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


--
Dmitry