[PATCH v2 2/5] usb_kbd: check for registering error

Aleksey Kuleshov rndfax at yandex.ru
Thu Mar 3 01:58:11 PST 2016


---
 drivers/input/usb_kbd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/input/usb_kbd.c b/drivers/input/usb_kbd.c
index e41266c..ff8e591 100644
--- a/drivers/input/usb_kbd.c
+++ b/drivers/input/usb_kbd.c
@@ -196,7 +196,11 @@ static int usb_kbd_probe(struct usb_device *usbdev,
 	} else
 		dev_dbg(&usbdev->dev, "poll keyboard via int ep\n");
 
-	input_device_register(&data->input);
+	ret = input_device_register(&data->input);
+	if (ret) {
+		dev_err(&usbdev->dev, "can't register input\n");
+		return ret;
+	}
 
 	data->poller.func = usb_kbd_poll;
 
-- 
2.6.2




More information about the barebox mailing list