pinctrl: renesas: rzg2l: Fix invalid unsigned return in rzg3s_oen_read()
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Wed, 9 Jul 2025 16:08:13 +0000 (17:08 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 11 Aug 2025 09:42:57 +0000 (11:42 +0200)
commit8912b2862b9b74a0dc4e3ea1aacdec2f8abd7e1d
treef9267cfcc18a46e2336c60cb7d987ff3060b95c4
parent8f5ae30d69d7543eee0d70083daf4de8fe15d585
pinctrl: renesas: rzg2l: Fix invalid unsigned return in rzg3s_oen_read()

rzg3s_oen_read() returns a u32 value, but previously propagated a negative
error code from rzg3s_pin_to_oen_bit(), resulting in an unintended large
positive value due to unsigned conversion. This caused incorrect
output-enable reporting for certain pins.

Without this patch, pins P1_0-P1_4 and P7_0-P7_4 are incorrectly reported
as "output enabled" in the pinconf-pins debugfs file. With this fix, only
P1_0-P1_1 and P7_0-P7_1 are shown as "output enabled", which matches the
hardware manual.

Fix this by returning 0 when the OEN bit lookup fails, treating the pin
as output-disabled by default.

Fixes: a9024a323af2 ("pinctrl: renesas: rzg2l: Clean up and refactor OEN read/write functions")
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/20250709160819.306875-2-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/pinctrl/renesas/pinctrl-rzg2l.c