Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: renesas: rzg2l: Return -EINVAL for pins which have input disabled

Pin status reported by pinconf-pins file always reported pin status as
"input enabled" even for pins which had input disabled. Fix this by
returning -EINVAL for the pins which have input disabled.

Fixes: c4c4637eb57f2 ("pinctrl: renesas: Add RZ/G2L pin and gpio controller driver")
Reported-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Phil Edworthy <phil.edworthy@renesas.com>
Link: https://lore.kernel.org/r/20220511094057.3151-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

authored by

Lad Prabhakar and committed by
Geert Uytterhoeven
5223c511 f2906aa8

+2
+2
drivers/pinctrl/renesas/pinctrl-rzg2l.c
··· 517 517 if (!(cfg & PIN_CFG_IEN)) 518 518 return -EINVAL; 519 519 arg = rzg2l_read_pin_config(pctrl, IEN(port_offset), bit, IEN_MASK); 520 + if (!arg) 521 + return -EINVAL; 520 522 break; 521 523 522 524 case PIN_CONFIG_POWER_SOURCE: {