summaryrefslogtreecommitdiff
path: root/drivers/usb/storage/usb.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2008-05-01 15:36:13 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-07-21 15:15:53 -0700
commit7119e3c37fbf7c27adb5929f344c826ecb8c7859 (patch)
tree7218b937cce2fa4b8a87ae1c682552381c906496 /drivers/usb/storage/usb.c
parent7e4d6c387994294ac8198b624ee71e75de60dfd2 (diff)
downloadlinux-3.10-7119e3c37fbf7c27adb5929f344c826ecb8c7859.tar.gz
linux-3.10-7119e3c37fbf7c27adb5929f344c826ecb8c7859.tar.bz2
linux-3.10-7119e3c37fbf7c27adb5929f344c826ecb8c7859.zip
usb-storage: change remaining semaphore to completion
This patch (as1090) converts the one remaining semaphore in usb-storage into a completion. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r--drivers/usb/storage/usb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 78c0c7ee6b9..6b14f8d253f 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)
for(;;) {
US_DEBUGP("*** thread sleeping.\n");
- if(down_interruptible(&us->sema))
+ if (wait_for_completion_interruptible(&us->cmnd_ready))
break;
-
+
US_DEBUGP("*** thread awakened.\n");
/* lock the device pointers */
@@ -825,7 +825,7 @@ static void usb_stor_release_resources(struct us_data *us)
*/
US_DEBUGP("-- sending exit command to thread\n");
set_bit(US_FLIDX_DISCONNECTING, &us->dflags);
- up(&us->sema);
+ complete(&us->cmnd_ready);
if (us->ctl_thread)
kthread_stop(us->ctl_thread);
@@ -975,7 +975,7 @@ static int storage_probe(struct usb_interface *intf,
us = host_to_us(host);
memset(us, 0, sizeof(struct us_data));
mutex_init(&(us->dev_mutex));
- init_MUTEX_LOCKED(&(us->sema));
+ init_completion(&us->cmnd_ready);
init_completion(&(us->notify));
init_waitqueue_head(&us->delay_wait);
init_completion(&us->scanning_done);