[PATCH] Input: uinput: document -ERANGE for UI_ABS_SETUP axis codes

From: Iván Ezequiel Rodriguez

Date: Wed Oct 28 2026 - 11:10:11 EST


uinput_abs_setup() returns -ERANGE when the axis code is greater than
ABS_MAX. The UI_ABS_SETUP kernel-doc only listed -EINVAL, -ENOMEM and
-EFAULT, which led to a mistaken attempt to change the errno.

Document -ERANGE instead of changing the long-standing user-visible
return value.

Suggested-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
Link: https://lore.kernel.org/linux-input/20260831192752.258550-3-ivanrwcm25@xxxxxxxxx/
Signed-off-by: Iván Ezequiel Rodriguez <ivanrwcm25@xxxxxxxxx>
---
include/uapi/linux/uinput.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/uinput.h b/include/uapi/linux/uinput.h
index c9e677e3af1d..4bbb9db1dbad 100644
--- a/include/uapi/linux/uinput.h
+++ b/include/uapi/linux/uinput.h
@@ -127,7 +127,8 @@ struct uinput_abs_setup {
* old kernel that does not support this ioctl.
*
* This ioctl may fail with -EINVAL if it is not supported or if you passed
- * incorrect values, -ENOMEM if the kernel runs out of memory or -EFAULT if the
+ * incorrect values, -ERANGE if the axis code is greater than ABS_MAX,
+ * -ENOMEM if the kernel runs out of memory or -EFAULT if the
* passed uinput_setup object cannot be read/written.
* If this call fails, partial data may have already been applied to the
* internal device.
--
2.43.0