Skip to content

Commit

Permalink
USB: BKL removal: ldusb
Browse files Browse the repository at this point in the history
BKL was not needed at all. Removed without replacement.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 92846fb commit 6248c52
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/usb/misc/ldusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/smp_lock.h>

#include <asm/uaccess.h>
#include <linux/input.h>
Expand Down Expand Up @@ -297,31 +296,25 @@ static int ld_usb_open(struct inode *inode, struct file *file)
int retval;
struct usb_interface *interface;

lock_kernel();
nonseekable_open(inode, file);
subminor = iminor(inode);

interface = usb_find_interface(&ld_usb_driver, subminor);

if (!interface) {
unlock_kernel();
err("%s - error, can't find device for minor %d\n",
__func__, subminor);
return -ENODEV;
}

dev = usb_get_intfdata(interface);

if (!dev) {
unlock_kernel();
if (!dev)
return -ENODEV;
}

/* lock this device */
if (mutex_lock_interruptible(&dev->mutex)) {
unlock_kernel();
if (mutex_lock_interruptible(&dev->mutex))
return -ERESTARTSYS;
}

/* allow opening only once */
if (dev->open_count) {
Expand Down Expand Up @@ -360,7 +353,6 @@ static int ld_usb_open(struct inode *inode, struct file *file)

unlock_exit:
mutex_unlock(&dev->mutex);
unlock_kernel();

return retval;
}
Expand Down

0 comments on commit 6248c52

Please sign in to comment.