[PATCH 7/7] gpio: cdev: return EOPNOTSUPP when HTE is unavailable

From: Iván Ezequiel Rodriguez

Date: Mon Aug 31 2026 - 14:16:15 EST


GPIO v2 documentation promises -EOPNOTSUPP when
GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE is requested without HTE hardware;
map -ENODEV from hte_ts_get() in the HTE-only edge setup path.

Signed-off-by: Iván Ezequiel Rodriguez <ivanrwcm25@xxxxxxxxx>
---
drivers/gpio/gpiolib-cdev.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c
index 9f3b628d5793..6dc01f7ea838 100644
--- a/drivers/gpio/gpiolib-cdev.c
+++ b/drivers/gpio/gpiolib-cdev.c
@@ -715,6 +715,8 @@ static int hte_edge_setup(struct line *line, u64 eflags)
line->desc);

ret = hte_ts_get(NULL, hdesc, 0);
+ if (ret == -ENODEV)
+ return -EOPNOTSUPP;
if (ret)
return ret;

--
2.43.0