diff mbox series

[1/1] Input: hil_kbd - Fix error return code in hil_dev_connect()

Message ID 20210515030053.6824-1-thunder.leizhen@huawei.com
State Accepted
Commit d9b576917a1d0efa293801a264150a1b37691617
Headers show
Series [1/1] Input: hil_kbd - Fix error return code in hil_dev_connect() | expand

Commit Message

Leizhen (ThunderTown) May 15, 2021, 3 a.m. UTC
Return error code -EPERM rather than '0' when the combo devices are not
supported.

Fixes: fa71c605c2bb ("Input: combine hil_kbd and hil_ptr drivers")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

---
 drivers/input/keyboard/hil_kbd.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.26.0.106.g9fadedd

Comments

Dmitry Torokhov May 25, 2021, 3:37 a.m. UTC | #1
Hi Zhen,

On Sat, May 15, 2021 at 11:00:53AM +0800, Zhen Lei wrote:
> Return error code -EPERM rather than '0' when the combo devices are not


I believe -EINVAL suits better here, so I used it and applied, thank
you.

Thanks.

-- 
Dmitry
diff mbox series

Patch

diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c
index bb29a7c9a1c0cf5..ca38e8e20bb5484 100644
--- a/drivers/input/keyboard/hil_kbd.c
+++ b/drivers/input/keyboard/hil_kbd.c
@@ -512,6 +512,7 @@  static int hil_dev_connect(struct serio *serio, struct serio_driver *drv)
 		    HIL_IDD_NUM_AXES_PER_SET(*idd)) {
 			printk(KERN_INFO PREFIX
 				"combo devices are not supported.\n");
+			error = -EPERM;
 			goto bail1;
 		}