Commit 3f78a28037c65b92d2717b7787902a853c2506a4
Committed by
Marek Vasut
1 parent
6e78c74f62
Exists in
v2017.01-smarct4x
and in
37 other branches
usb: kbd: Remove check for already being registered
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>
Showing 1 changed file with 1 additions and 11 deletions Side-by-side Diff
common/usb_kbd.c
... | ... | @@ -490,7 +490,7 @@ |
490 | 490 | /* Search for keyboard and register it if found. */ |
491 | 491 | int drv_usb_kbd_init(void) |
492 | 492 | { |
493 | - struct stdio_dev usb_kbd_dev, *old_dev; | |
493 | + struct stdio_dev usb_kbd_dev; | |
494 | 494 | struct usb_device *dev; |
495 | 495 | char *stdinname = getenv("stdin"); |
496 | 496 | int error, i; |
... | ... | @@ -508,16 +508,6 @@ |
508 | 508 | /* Try probing the keyboard */ |
509 | 509 | if (usb_kbd_probe(dev, 0) != 1) |
510 | 510 | continue; |
511 | - | |
512 | - /* We found a keyboard, check if it is already registered. */ | |
513 | - debug("USB KBD: found set up device.\n"); | |
514 | - old_dev = stdio_get_by_name(DEVNAME); | |
515 | - if (old_dev) { | |
516 | - /* Already registered, just return ok. */ | |
517 | - debug("USB KBD: is already registered.\n"); | |
518 | - usb_kbd_deregister(); | |
519 | - return 1; | |
520 | - } | |
521 | 511 | |
522 | 512 | /* Register the keyboard */ |
523 | 513 | debug("USB KBD: register.\n"); |