mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-07-23 07:12:25 +00:00
Prevent USB commands from working when USB is stopped.
This commit is contained in:
parent
7455af41d1
commit
e51aae3829
3 changed files with 12 additions and 0 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue