Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
[sfrench/cifs-2.6.git] / drivers / block / ub.c
index c48e148785827677b900e961f84b5d52b01e5acb..9ae3bb713286f0d0d3a959a81f7f4b4db5cde1db 100644 (file)
@@ -28,7 +28,7 @@
 #include <linux/timer.h>
 #include <linux/scatterlist.h>
 #include <linux/slab.h>
-#include <linux/smp_lock.h>
+#include <linux/mutex.h>
 #include <scsi/scsi.h>
 
 #define DRV_NAME "ub"
@@ -248,6 +248,7 @@ struct ub_completion {
        spinlock_t lock;
 };
 
+static DEFINE_MUTEX(ub_mutex);
 static inline void ub_init_completion(struct ub_completion *x)
 {
        x->done = 0;
@@ -396,7 +397,7 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum);
 #else
 
 static const struct usb_device_id ub_usb_ids[] = {
-       { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_SCSI, US_PR_BULK) },
+       { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, USB_SC_SCSI, USB_PR_BULK) },
        { }
 };
 
@@ -1715,9 +1716,9 @@ static int ub_bd_unlocked_open(struct block_device *bdev, fmode_t mode)
 {
        int ret;
 
-       lock_kernel();
+       mutex_lock(&ub_mutex);
        ret = ub_bd_open(bdev, mode);
-       unlock_kernel();
+       mutex_unlock(&ub_mutex);
 
        return ret;
 }
@@ -1730,9 +1731,9 @@ static int ub_bd_release(struct gendisk *disk, fmode_t mode)
        struct ub_lun *lun = disk->private_data;
        struct ub_dev *sc = lun->udev;
 
-       lock_kernel();
+       mutex_lock(&ub_mutex);
        ub_put(sc);
-       unlock_kernel();
+       mutex_unlock(&ub_mutex);
 
        return 0;
 }
@@ -1747,9 +1748,9 @@ static int ub_bd_ioctl(struct block_device *bdev, fmode_t mode,
        void __user *usermem = (void __user *) arg;
        int ret;
 
-       lock_kernel();
+       mutex_lock(&ub_mutex);
        ret = scsi_cmd_ioctl(disk->queue, disk, mode, cmd, usermem);
-       unlock_kernel();
+       mutex_unlock(&ub_mutex);
 
        return ret;
 }