diff options
author | Hans de Goede <hdegoede@redhat.com> | 2014-09-20 16:54:38 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2014-10-06 14:50:43 +0200 |
commit | 8a8a2257ec55a997d97edf6664249a628248fe01 (patch) | |
tree | 703e51bac2512fe3bf2d171acf51444010fac5f3 /common/cmd_usb.c | |
parent | 32d019265d1f0c334f2f86407abf295d46bd2f4d (diff) | |
download | u-boot-imx-8a8a2257ec55a997d97edf6664249a628248fe01.zip u-boot-imx-8a8a2257ec55a997d97edf6664249a628248fe01.tar.gz u-boot-imx-8a8a2257ec55a997d97edf6664249a628248fe01.tar.bz2 |
usb: kbd: Allow "usb reset" to continue when an usb kbd is used
Use the new force parameter to make the stdio_deregister succeed, replacing
stdin with a nulldev, and assume that the usb keyboard will come back after
the reset.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'common/cmd_usb.c')
-rw-r--r-- | common/cmd_usb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/cmd_usb.c b/common/cmd_usb.c index b2aa44c..c192498 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -430,10 +430,10 @@ static int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } #endif /* CONFIG_USB_STORAGE */ -static int do_usb_stop_keyboard(void) +static int do_usb_stop_keyboard(int force) { #ifdef CONFIG_USB_KEYBOARD - if (usb_kbd_deregister() != 0) { + if (usb_kbd_deregister(force) != 0) { printf("USB not stopped: usbkbd still using USB\n"); return 1; } @@ -460,7 +460,7 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if ((strncmp(argv[1], "reset", 5) == 0) || (strncmp(argv[1], "start", 5) == 0)) { bootstage_mark_name(BOOTSTAGE_ID_USB_START, "usb_start"); - if (do_usb_stop_keyboard() != 0) + if (do_usb_stop_keyboard(1) != 0) return 1; usb_stop(); printf("(Re)start USB...\n"); @@ -482,7 +482,7 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (strncmp(argv[1], "stop", 4) == 0) { if (argc != 2) console_assign(stdin, "serial"); - if (do_usb_stop_keyboard() != 0) + if (do_usb_stop_keyboard(0) != 0) return 1; printf("stopping USB..\n"); usb_stop(); |