diff --git a/cmd/usb.c b/cmd/usb.c index 455127c..4fa456e 100644 --- a/cmd/usb.c +++ b/cmd/usb.c @@ -571,11 +571,11 @@ static void do_usb_start(void) return; /* Driver model will probe the devices as they are found */ -#ifndef CONFIG_DM_USB # ifdef CONFIG_USB_STORAGE /* try to recognize storage devices immediately */ usb_stor_curr_dev = usb_stor_scan(1); # endif +#ifndef CONFIG_DM_USB # ifdef CONFIG_USB_KEYBOARD drv_usb_kbd_init(); # endif diff --git a/common/usb_storage.c b/common/usb_storage.c index 0345aa2..b524a15 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -303,7 +303,6 @@ void usb_stor_reset(void) usb_max_devs = 0; } -#ifndef CONFIG_DM_USB /******************************************************************************* * scan the usb and reports device info * to the user if mode = 1 @@ -311,11 +310,12 @@ void usb_stor_reset(void) */ int usb_stor_scan(int mode) { - unsigned char i; - if (mode == 1) printf(" scanning usb for storage devices... "); +#ifndef CONFIG_DM_USB + unsigned char i; + usb_disable_asynch(1); /* asynch transfer not allowed */ usb_stor_reset(); @@ -329,12 +329,12 @@ int usb_stor_scan(int mode) } /* for */ usb_disable_asynch(0); /* asynch transfer allowed */ +#endif printf("%d Storage Device(s) found\n", usb_max_devs); if (usb_max_devs > 0) return 0; return -1; } -#endif static int usb_stor_irq(struct usb_device *dev) {