Prevent USB commands from working when USB is stopped.
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 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 @@
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));