The dabusb device driver is sufficiently serialized using
its own mutex, no need for the big kernel lock here
in addition.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
#include <linux/list.h>
#include <linux/vmalloc.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/vmalloc.h>
#include <linux/slab.h>
-#include <linux/smp_lock.h>
#include <linux/init.h>
#include <asm/uaccess.h>
#include <asm/atomic.h>
#include <linux/init.h>
#include <asm/uaccess.h>
#include <asm/atomic.h>
if (devnum < DABUSB_MINOR || devnum >= (DABUSB_MINOR + NRDABUSB))
return -EIO;
if (devnum < DABUSB_MINOR || devnum >= (DABUSB_MINOR + NRDABUSB))
return -EIO;
s = &dabusb[devnum - DABUSB_MINOR];
dbg("dabusb_open");
s = &dabusb[devnum - DABUSB_MINOR];
dbg("dabusb_open");
while (!s->usbdev || s->opened) {
mutex_unlock(&s->mutex);
while (!s->usbdev || s->opened) {
mutex_unlock(&s->mutex);
- if (file->f_flags & O_NONBLOCK) {
+ if (file->f_flags & O_NONBLOCK)
msleep_interruptible(500);
msleep_interruptible(500);
- if (signal_pending (current)) {
- unlock_kernel();
+ if (signal_pending (current))
mutex_lock(&s->mutex);
}
if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) {
mutex_unlock(&s->mutex);
dev_err(&s->usbdev->dev, "set_interface failed\n");
mutex_lock(&s->mutex);
}
if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) {
mutex_unlock(&s->mutex);
dev_err(&s->usbdev->dev, "set_interface failed\n");
return -EINVAL;
}
s->opened = 1;
return -EINVAL;
}
s->opened = 1;
file->private_data = s;
r = nonseekable_open(inode, file);
file->private_data = s;
r = nonseekable_open(inode, file);
- lock_kernel();
- if (s->remove_pending) {
- unlock_kernel();
mutex_lock(&s->mutex);
if (!s->usbdev) {
mutex_unlock(&s->mutex);
mutex_lock(&s->mutex);
if (!s->usbdev) {
mutex_unlock(&s->mutex);
break;
}
mutex_unlock(&s->mutex);
break;
}
mutex_unlock(&s->mutex);