diff --git a/common/usb.c b/common/usb.c index 9502f39..52e5964 100644 --- a/common/usb.c +++ b/common/usb.c @@ -126,10 +126,15 @@ int usb_init(void) */ int usb_stop(void) { - asynch_allowed=1; - usb_started = 0; - usb_hub_reset(); - return usb_lowlevel_stop(); + int res = 0; + + if (usb_started) { + asynch_allowed = 1; + usb_started = 0; + usb_hub_reset(); + res = usb_lowlevel_stop(); + } + return res; } /* diff --git a/drivers/usb/usb_ohci.c b/drivers/usb/usb_ohci.c index fd5567f..da11ecb 100644 --- a/drivers/usb/usb_ohci.c +++ b/drivers/usb/usb_ohci.c @@ -1943,7 +1943,9 @@ int usb_lowlevel_stop(void) if(usb_cpu_stop()) return -1; #endif - + /* This driver is no longer initialised. It needs a new low-level + * init (board/cpu) before it can be used again. */ + ohci_inited = 0; return 0; } #endif /* CONFIG_USB_OHCI_NEW */