From a12e25bd59e36d12dcd026ffa3c65d48b5cf5442 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Wed, 11 Jan 2006 08:39:45 -0500 Subject: [SCSI] sem2mutex 3w-[x9]xxx Convert a the 3w-9xxx.c and 3w-xxxx.c drivers to use mutexes instead of semaphores. Untested, but compiles and looks obviously correct. Signed-off-by: Jes Sorensen Signed-off-by: James Bottomley --- drivers/scsi/3w-9xxx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/scsi/3w-9xxx.c') diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index 3ff74f472249..31c497542272 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include @@ -615,7 +616,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int void __user *argp = (void __user *)arg; /* Only let one of these through at a time */ - if (down_interruptible(&tw_dev->ioctl_sem)) { + if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) { retval = TW_IOCTL_ERROR_OS_EINTR; goto out; } @@ -852,7 +853,7 @@ out3: /* Now free ioctl buf memory */ dma_free_coherent(&tw_dev->tw_pci_dev->dev, data_buffer_length_adjusted+sizeof(TW_Ioctl_Buf_Apache) - 1, cpu_addr, dma_handle); out2: - up(&tw_dev->ioctl_sem); + mutex_unlock(&tw_dev->ioctl_lock); out: return retval; } /* End twa_chrdev_ioctl() */ @@ -1182,7 +1183,7 @@ static int twa_initialize_device_extension(TW_Device_Extension *tw_dev) tw_dev->error_sequence_id = 1; tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE; - init_MUTEX(&tw_dev->ioctl_sem); + mutex_init(&tw_dev->ioctl_lock); init_waitqueue_head(&tw_dev->ioctl_wqueue); retval = 0; -- cgit v1.2.3