[PATCH] staging: nvec: kbd: use -EINVAL instead of -1
From: Soham Kute
Date: Sat Feb 28 2026 - 15:20:30 EST
Return proper error code -EINVAL instead of -1 when
the event type or code is not supported.
Signed-off-by: Soham Kute <officialsohamkute@xxxxxxxxx>
---
drivers/staging/nvec/nvec_kbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/nvec/nvec_kbd.c b/drivers/staging/nvec/nvec_kbd.c
index d2b91318f151..5f742c8b32cc 100644
--- a/drivers/staging/nvec/nvec_kbd.c
+++ b/drivers/staging/nvec/nvec_kbd.c
@@ -92,10 +92,10 @@ static int nvec_kbd_event(struct input_dev *dev, unsigned int type,
return 0;
if (type != EV_LED)
- return -1;
+ return -EINVAL;
if (code != LED_CAPSL)
- return -1;
+ return -EINVAL;
buf[2] = !!value;
nvec_write_async(nvec, buf, sizeof(buf));
--
2.34.1