]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pinctrl: renesas: rzg2l: Update OEN pin validation to use exact match
authorBiju Das <biju.das.jz@bp.renesas.com>
Thu, 30 Apr 2026 09:34:09 +0000 (10:34 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 11 May 2026 09:07:07 +0000 (11:07 +0200)
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@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260430093422.74812-5-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/pinctrl/renesas/pinctrl-rzg2l.c

index 7b1bb66d4ff6ff214908dc9271844bbc14e3b5e5..2a46ba7b3709a9f8bfdb4268b8b235ac12ae3b78 100644 (file)
@@ -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;
 
        /*