summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/usb.c13
1 files changed, 9 insertions, 4 deletions
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;
}
/*