diff options
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r-- | drivers/usb/storage/usb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 78c0c7ee6b99..6b14f8d253f1 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c | |||
@@ -312,9 +312,9 @@ static int usb_stor_control_thread(void * __us) | |||
312 | 312 | ||
313 | for(;;) { | 313 | for(;;) { |
314 | US_DEBUGP("*** thread sleeping.\n"); | 314 | US_DEBUGP("*** thread sleeping.\n"); |
315 | if(down_interruptible(&us->sema)) | 315 | if (wait_for_completion_interruptible(&us->cmnd_ready)) |
316 | break; | 316 | break; |
317 | 317 | ||
318 | US_DEBUGP("*** thread awakened.\n"); | 318 | US_DEBUGP("*** thread awakened.\n"); |
319 | 319 | ||
320 | /* lock the device pointers */ | 320 | /* lock the device pointers */ |
@@ -825,7 +825,7 @@ static void usb_stor_release_resources(struct us_data *us) | |||
825 | */ | 825 | */ |
826 | US_DEBUGP("-- sending exit command to thread\n"); | 826 | US_DEBUGP("-- sending exit command to thread\n"); |
827 | set_bit(US_FLIDX_DISCONNECTING, &us->dflags); | 827 | set_bit(US_FLIDX_DISCONNECTING, &us->dflags); |
828 | up(&us->sema); | 828 | complete(&us->cmnd_ready); |
829 | if (us->ctl_thread) | 829 | if (us->ctl_thread) |
830 | kthread_stop(us->ctl_thread); | 830 | kthread_stop(us->ctl_thread); |
831 | 831 | ||
@@ -975,7 +975,7 @@ static int storage_probe(struct usb_interface *intf, | |||
975 | us = host_to_us(host); | 975 | us = host_to_us(host); |
976 | memset(us, 0, sizeof(struct us_data)); | 976 | memset(us, 0, sizeof(struct us_data)); |
977 | mutex_init(&(us->dev_mutex)); | 977 | mutex_init(&(us->dev_mutex)); |
978 | init_MUTEX_LOCKED(&(us->sema)); | 978 | init_completion(&us->cmnd_ready); |
979 | init_completion(&(us->notify)); | 979 | init_completion(&(us->notify)); |
980 | init_waitqueue_head(&us->delay_wait); | 980 | init_waitqueue_head(&us->delay_wait); |
981 | init_completion(&us->scanning_done); | 981 | init_completion(&us->scanning_done); |