diff options
| -rw-r--r-- | common/usb.c | 13 | ||||
| -rw-r--r-- | drivers/usb/usb_ohci.c | 4 | 
2 files changed, 12 insertions, 5 deletions
| diff --git a/common/usb.c b/common/usb.c index 9502f3903..52e5964c7 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 fd5567f71..da11ecbc0 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 */ |