Skip to content

Commit d56abfe

Browse files
prabhakarladgeertu
authored andcommitted
pinctrl: renesas: rzg2l: Return -EINVAL if the pin doesn't support PIN_CFG_OEN
Update the rzg2l_pinctrl_pinconf_get() function to return -EINVAL for PIN_CONFIG_OUTPUT_ENABLE config if the pin doesn't support the PIN_CFG_OEN configuration. -EINVAL is a valid error when dumping the pin configurations. Returning -EOPNOTSUPP for a pin that does not support PIN_CFG_OEN resulted in the message 'ERROR READING CONFIG SETTING 16' being printed during dumping pinconf-pins. For consistency do similar change in rzg2l_pinctrl_pinconf_set() for PIN_CONFIG_OUTPUT_ENABLE config. Fixes: a9024a3 ("pinctrl: renesas: rzg2l: Clean up and refactor OEN read/write functions") Signed-off-by: Lad Prabhakar <[email protected]> Tested-by: Claudiu Beznea <[email protected]> Reviewed-by: Paul Barker <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent f82c086 commit d56abfe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/pinctrl/renesas/pinctrl-rzg2l.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,9 @@ static int rzg2l_pinctrl_pinconf_get(struct pinctrl_dev *pctldev,
12611261
break;
12621262

12631263
case PIN_CONFIG_OUTPUT_ENABLE:
1264-
if (!pctrl->data->oen_read || !(cfg & PIN_CFG_OEN))
1264+
if (!(cfg & PIN_CFG_OEN))
1265+
return -EINVAL;
1266+
if (!pctrl->data->oen_read)
12651267
return -EOPNOTSUPP;
12661268
arg = pctrl->data->oen_read(pctrl, _pin);
12671269
if (!arg)
@@ -1402,7 +1404,9 @@ static int rzg2l_pinctrl_pinconf_set(struct pinctrl_dev *pctldev,
14021404

14031405
case PIN_CONFIG_OUTPUT_ENABLE:
14041406
arg = pinconf_to_config_argument(_configs[i]);
1405-
if (!pctrl->data->oen_write || !(cfg & PIN_CFG_OEN))
1407+
if (!(cfg & PIN_CFG_OEN))
1408+
return -EINVAL;
1409+
if (!pctrl->data->oen_write)
14061410
return -EOPNOTSUPP;
14071411
ret = pctrl->data->oen_write(pctrl, _pin, !!arg);
14081412
if (ret)

0 commit comments

Comments
 (0)