Commit 31678e68f826 for kernel
commit 31678e68f82636a27fbad58ae40054557da4fd7e
Author: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Date: Wed Nov 18 13:45:19 2026 +0100
gpio: shared-proxy: propagate -ENOTSUPP from .set_config()
The gpio-shared-proxy driver does not propagate -ENOTSUPP returned from
the set_config() callback by real GPIO drivers controlling the shared
GPIOs. This can lead to a situation where for an open-drain, shared GPIO,
we take the emulation path on request - ending up setting the direction
to input for the initial user - and then fail to allow simulated output
direction for the second user if the driver in question does not
support using "real" open-drain.
Propagate all errors from the underlying .set_config() call in
gpio_shared_proxy_set_config().
Reported-by: Igor Velkov <iav@iav.lv>
Closes: https://lore.kernel.org/all/20261115-hc4-gpio-shared-od-1@iav.lv/
Fixes: e992d54c6f97 ("gpio: shared-proxy: implement the shared GPIO proxy driver")
Tested-by: Igor Velkov <iav@iav.lv>
Link: https://patch.msgid.link/20261118-gpio-shared-proxy-enotsupp-v1-1-39d3fe4d3aa7@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
diff --git a/drivers/gpio/gpio-shared-proxy.c b/drivers/gpio/gpio-shared-proxy.c
index 80412bd4ef25..60973acc709c 100644
--- a/drivers/gpio/gpio-shared-proxy.c
+++ b/drivers/gpio/gpio-shared-proxy.c
@@ -186,7 +186,7 @@ static int gpio_shared_proxy_set_config(struct gpio_chip *gc,
}
ret = gpiod_set_config(desc, cfg);
- if (ret && ret != -ENOTSUPP)
+ if (ret)
return ret;
shared_desc->cfg = cfg;