The dm usb_kbd_remove function() will deregister the usb keyboard for
us on a "usb reset" / "usb stop" so there is no need to manually call
usb_kbd_deregister() in the dm case.
This commit removes usb_kbd_deregister() in the dm case fixing the
following "usb reset" errors:
usb_kbd_remove: warning, ret=-6
device_remove: Device 'usb_kbd' failed to remove, but children are gone
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
static int do_usb_stop_keyboard(int force)
{
-#ifdef CONFIG_USB_KEYBOARD
+#if !defined CONFIG_DM_USB && defined CONFIG_USB_KEYBOARD
if (usb_kbd_deregister(force) != 0) {
printf("USB not stopped: usbkbd still using USB\n");
return 1;
/* No USB Keyboard found */
return -1;
}
-#endif
/* Deregister the keyboard. */
int usb_kbd_deregister(int force)
#endif
}
+#endif
+
#ifdef CONFIG_DM_USB
static int usb_kbd_probe(struct udevice *dev)