diff mbox series

[v1,1/1] gpio: cdev: return EOPNOTSUPP when HTE is unavailable

Message ID 20260831152306.166630-2-ivanrwcm25@gmail.com
State New
Headers show
Series gpio: cdev: EOPNOTSUPP when HTE unavailable | expand

Commit Message

Iván Ezequiel Rodriguez Aug. 31, 2026, 3:23 p.m. UTC
Map hte_ts_get() -ENODEV to -EOPNOTSUPP so userspace sees the same
errno as when CONFIG_HTE is disabled or EVENT_CLOCK_HTE is unsupported.

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

Comments

Bartosz Golaszewski Sept. 2, 2026, 10:37 a.m. UTC | #1
On Mon, 31 Aug 2026 12:23:06 -0300, Iván Ezequiel Rodriguez wrote:
> Map hte_ts_get() -ENODEV to -EOPNOTSUPP so userspace sees the same
> errno as when CONFIG_HTE is disabled or EVENT_CLOCK_HTE is unsupported.
> 
> 

Makes sense. I hope it will not break any user-space users, though that's
highly unlikely.

[1/1] gpio: cdev: return EOPNOTSUPP when HTE is unavailable
      https://git.kernel.org/brgl/c/cf176c115497bc6462391c3118bedfd212092c4d

Best regards,
diff mbox series

Patch

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;