usb: kbd: Remove check for already being registered
authorHans de Goede <hdegoede@redhat.com>
Sat, 20 Sep 2014 14:54:36 +0000 (16:54 +0200)
committerMarek Vasut <marex@denx.de>
Mon, 6 Oct 2014 12:50:43 +0000 (14:50 +0200)
We now always properly deregister the keyboard before calling
drv_usb_kbd_init(), so we can drop the check for already being registered.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
common/usb_kbd.c

index 4c17b0d8ec37052d0349a87d02c9ecf839754756..d4d5f485218c7e915411bdac4fcea7863b4cb885 100644 (file)
@@ -490,7 +490,7 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum)
 /* Search for keyboard and register it if found. */
 int drv_usb_kbd_init(void)
 {
-       struct stdio_dev usb_kbd_dev, *old_dev;
+       struct stdio_dev usb_kbd_dev;
        struct usb_device *dev;
        char *stdinname = getenv("stdin");
        int error, i;
@@ -509,16 +509,6 @@ int drv_usb_kbd_init(void)
                if (usb_kbd_probe(dev, 0) != 1)
                        continue;
 
-               /* We found a keyboard, check if it is already registered. */
-               debug("USB KBD: found set up device.\n");
-               old_dev = stdio_get_by_name(DEVNAME);
-               if (old_dev) {
-                       /* Already registered, just return ok. */
-                       debug("USB KBD: is already registered.\n");
-                       usb_kbd_deregister();
-                       return 1;
-               }
-
                /* Register the keyboard */
                debug("USB KBD: register.\n");
                memset(&usb_kbd_dev, 0, sizeof(struct stdio_dev));