Commit 7ff52efd authored by Arnd Bergmann's avatar Arnd Bergmann

dabusb: remove the BKL

The dabusb device driver is sufficiently serialized using
its own mutex, no need for the big kernel lock here
in addition.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
parent a6f8dbc6
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/atomic.h> #include <asm/atomic.h>
...@@ -621,7 +620,6 @@ static int dabusb_open (struct inode *inode, struct file *file) ...@@ -621,7 +620,6 @@ static int dabusb_open (struct inode *inode, struct file *file)
if (devnum < DABUSB_MINOR || devnum >= (DABUSB_MINOR + NRDABUSB)) if (devnum < DABUSB_MINOR || devnum >= (DABUSB_MINOR + NRDABUSB))
return -EIO; return -EIO;
lock_kernel();
s = &dabusb[devnum - DABUSB_MINOR]; s = &dabusb[devnum - DABUSB_MINOR];
dbg("dabusb_open"); dbg("dabusb_open");
...@@ -630,21 +628,17 @@ static int dabusb_open (struct inode *inode, struct file *file) ...@@ -630,21 +628,17 @@ static int dabusb_open (struct inode *inode, struct file *file)
while (!s->usbdev || s->opened) { while (!s->usbdev || s->opened) {
mutex_unlock(&s->mutex); mutex_unlock(&s->mutex);
if (file->f_flags & O_NONBLOCK) { if (file->f_flags & O_NONBLOCK)
return -EBUSY; return -EBUSY;
}
msleep_interruptible(500); msleep_interruptible(500);
if (signal_pending (current)) { if (signal_pending (current))
unlock_kernel();
return -EAGAIN; return -EAGAIN;
}
mutex_lock(&s->mutex); mutex_lock(&s->mutex);
} }
if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) { if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) {
mutex_unlock(&s->mutex); mutex_unlock(&s->mutex);
dev_err(&s->usbdev->dev, "set_interface failed\n"); dev_err(&s->usbdev->dev, "set_interface failed\n");
unlock_kernel();
return -EINVAL; return -EINVAL;
} }
s->opened = 1; s->opened = 1;
...@@ -654,7 +648,6 @@ static int dabusb_open (struct inode *inode, struct file *file) ...@@ -654,7 +648,6 @@ static int dabusb_open (struct inode *inode, struct file *file)
file->private_data = s; file->private_data = s;
r = nonseekable_open(inode, file); r = nonseekable_open(inode, file);
unlock_kernel();
return r; return r;
} }
...@@ -689,17 +682,13 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg ...@@ -689,17 +682,13 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg
dbg("dabusb_ioctl"); dbg("dabusb_ioctl");
lock_kernel(); if (s->remove_pending)
if (s->remove_pending) {
unlock_kernel();
return -EIO; return -EIO;
}
mutex_lock(&s->mutex); mutex_lock(&s->mutex);
if (!s->usbdev) { if (!s->usbdev) {
mutex_unlock(&s->mutex); mutex_unlock(&s->mutex);
unlock_kernel();
return -EIO; return -EIO;
} }
...@@ -735,7 +724,6 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg ...@@ -735,7 +724,6 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg
break; break;
} }
mutex_unlock(&s->mutex); mutex_unlock(&s->mutex);
unlock_kernel();
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment