X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fscsi%2F3w-sas.c;h=6a95d111d207269a920fc57c8ceee220ac5d42d8;hb=092e0e7e520a1fca03e13c9f2d157432a8657ff2;hp=7afac93d889fda72404f8b2962f28c02401c6457;hpb=776c163b1b93c8dfa5edba885bc2bfbc2d228a5f;p=mv-sheeva.git diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index 7afac93d889..6a95d111d20 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c @@ -64,7 +64,6 @@ #include #include #include -#include #include #include #include @@ -77,6 +76,7 @@ /* Globals */ #define TW_DRIVER_VERSION "3.26.02.000" +static DEFINE_MUTEX(twl_chrdev_mutex); static TW_Device_Extension *twl_device_extension_list[TW_MAX_SLOT]; static unsigned int twl_device_extension_count; static int twl_major = -1; @@ -764,7 +764,7 @@ static long twl_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long int retval = -EFAULT; void __user *argp = (void __user *)arg; - lock_kernel(); + mutex_lock(&twl_chrdev_mutex); /* Only let one of these through at a time */ if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) { @@ -861,7 +861,7 @@ out3: out2: mutex_unlock(&tw_dev->ioctl_lock); out: - unlock_kernel(); + mutex_unlock(&twl_chrdev_mutex); return retval; } /* End twl_chrdev_ioctl() */ @@ -876,7 +876,6 @@ static int twl_chrdev_open(struct inode *inode, struct file *file) goto out; } - cycle_kernel_lock(); minor_number = iminor(inode); if (minor_number >= twl_device_extension_count) goto out;