[PATCH v4 4/7] pinctrl: renesas: rzg2l: Update OEN pin validation to use exact match
From: Biju
Date: Thu Apr 30 2026 - 05:38:35 EST
From: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
The RZ/G2L SoC uses pin 0 from a port for OEN while RZ/G3L uses pin 1. The
existing greater-than comparison against oen_max_pin in
rzg2l_pin_to_oen_bit() would incorrectly accept any pin below that value
rather than enforcing the single valid OEN pin for each SoC. Replace the
range check with an exact equality test so that only the designated OEN
pin is accepted.
Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
---
v4:
* New patch.
---
drivers/pinctrl/renesas/pinctrl-rzg2l.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index 7b1bb66d4ff6..2a46ba7b3709 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -1124,7 +1124,7 @@ static int rzg2l_pin_to_oen_bit(struct rzg2l_pinctrl *pctrl, unsigned int _pin)
u64 caps = FIELD_GET(PIN_CFG_MASK, *pin_data);
u8 pin = RZG2L_PIN_ID_TO_PIN(_pin);
- if (pin > pctrl->data->hwcfg->oen_max_pin)
+ if (pin != pctrl->data->hwcfg->oen_max_pin)
return -EINVAL;
/*
--
2.43.0