diff mbox series

[1/2] pinctrl: stm32: return proper error code in pin_config_set

Message ID 20200615125951.28008-2-alexandre.torgue@st.com
State Accepted
Commit d9665bb82269f0f2bc18b73f074754e452bb3767
Headers show
Series pinctrl: stm32: Add possibility to configure only one pin | expand

Commit Message

Alexandre TORGUE June 15, 2020, 12:59 p.m. UTC
".pin_config_set" or ".pin_config_group_set" can be called with a
configuration not supported (i.e. PIN_CONFIG_PERSIST_STATE). In this case,
it is more suitable to return -ENOTSUPP instead of -EINVAL.

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
diff mbox series

Patch

diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index a657cd829ce6..5d9839beaa07 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -1084,7 +1084,7 @@  static int stm32_pconf_parse_conf(struct pinctrl_dev *pctldev,
 		ret = stm32_pmx_gpio_set_direction(pctldev, range, pin, false);
 		break;
 	default:
-		ret = -EINVAL;
+		ret = -ENOTSUPP;
 	}
 
 	return ret;