Commit 3b20fd83 authored by Ryan CHEN's avatar Ryan CHEN Committed by Wolfgang Denk

Correct drv_usb_kbd_init function

The patch is that check if usb_get_dev_index() function return valid
pointer. If valid, continue. Otherwise return -1.
Signed-off-by: default avatarRyan Chen <>
Acked-by: default avatarMarkus Klotzbuecher <>
parent eba1f2fc
......@@ -162,6 +162,8 @@ int drv_usb_kbd_init(void)
/* scan all USB Devices */
for(i=0;i<USB_MAX_DEVICE;i++) {
dev=usb_get_dev_index(i); /* get device */
if(dev == NULL)
return -1;
if(dev->devnum!=-1) {
if(usb_kbd_probe(dev,0)==1) { /* Ok, we found a keyboard */
/* check, if it is already registered */
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment