[PATCH 2/2] gpiolib: Allow drivers to return EOPNOTSUPP from config

From: Matti Vaittinen
Date: Mon Mar 29 2021 - 07:42:37 EST


The checkpacth instructs to switch from ENOSUPP to EOPNOTSUPP.
> WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP

Make the gpiolib allow drivers to return both so driver developers
can avoid one of the checkpatch complaints.

Signed-off-by: Matti Vaittinen <matti.vaittinen@xxxxxxxxxxxxxxxxx>
---
drivers/gpio/gpiolib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 6367646dce83..60d61a6314b0 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2134,7 +2134,7 @@ static int gpio_set_config_with_argument_optional(struct gpio_desc *desc,
int ret;

ret = gpio_set_config_with_argument(desc, mode, argument);
- if (ret != -ENOTSUPP)
+ if (ret != -ENOTSUPP && ret != -EOPNOTSUPP)
return ret;

switch (mode) {
--
2.25.4


--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =]