summaryrefslogtreecommitdiff
path: root/common/cmd_usb.c
diff options
context:
space:
mode:
authorBartlomiej Sieka <tur@semihalf.com>2006-08-03 23:20:13 +0200
committerBartlomiej Sieka <tur@semihalf.com>2006-08-03 23:20:13 +0200
commite51aae382979dd838cd5d4027bb21072b7f03a20 (patch)
tree09a2d64cb23c360373fb06a2b6d0b752431e188f /common/cmd_usb.c
parent7455af41d19d5e0194e23f3b06f1bf64e3430d62 (diff)
downloadu-boot-imx-e51aae382979dd838cd5d4027bb21072b7f03a20.zip
u-boot-imx-e51aae382979dd838cd5d4027bb21072b7f03a20.tar.gz
u-boot-imx-e51aae382979dd838cd5d4027bb21072b7f03a20.tar.bz2
Prevent USB commands from working when USB is stopped.
Diffstat (limited to 'common/cmd_usb.c')
-rw-r--r--common/cmd_usb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index fcc6662..28c05aa 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -444,6 +444,7 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int i;
struct usb_device *dev = NULL;
+ extern char usb_started;
#ifdef CONFIG_USB_STORAGE
block_dev_desc_t *stor_dev;
#endif
@@ -477,6 +478,10 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
usb_stop();
return 0;
}
+ if (!usb_started) {
+ printf("USB is stopped. Please issue 'usb start' first.\n");
+ return 1;
+ }
if (strncmp(argv[1],"tree",4) == 0) {
printf("\nDevice Tree:\n");
usb_show_tree(usb_get_dev_index(0));