Commit 1170656d authored by Alessio Igor Bogani's avatar Alessio Igor Bogani Committed by Greg Kroah-Hartman

USB: sisusbvga: Remove the BKL from open

BKL is not needed here because necessary locking is already provided
by mutex sisusb->lock.
Signed-off-by: default avatarAlessio Igor Bogani <abogani@texware.it>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 31436a1a
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/kref.h> #include <linux/kref.h>
#include <linux/usb.h> #include <linux/usb.h>
#include <linux/smp_lock.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include "sisusb.h" #include "sisusb.h"
...@@ -2416,14 +2415,11 @@ sisusb_open(struct inode *inode, struct file *file) ...@@ -2416,14 +2415,11 @@ sisusb_open(struct inode *inode, struct file *file)
struct usb_interface *interface; struct usb_interface *interface;
int subminor = iminor(inode); int subminor = iminor(inode);
lock_kernel();
if (!(interface = usb_find_interface(&sisusb_driver, subminor))) { if (!(interface = usb_find_interface(&sisusb_driver, subminor))) {
unlock_kernel();
return -ENODEV; return -ENODEV;
} }
if (!(sisusb = usb_get_intfdata(interface))) { if (!(sisusb = usb_get_intfdata(interface))) {
unlock_kernel();
return -ENODEV; return -ENODEV;
} }
...@@ -2431,13 +2427,11 @@ sisusb_open(struct inode *inode, struct file *file) ...@@ -2431,13 +2427,11 @@ sisusb_open(struct inode *inode, struct file *file)
if (!sisusb->present || !sisusb->ready) { if (!sisusb->present || !sisusb->ready) {
mutex_unlock(&sisusb->lock); mutex_unlock(&sisusb->lock);
unlock_kernel();
return -ENODEV; return -ENODEV;
} }
if (sisusb->isopen) { if (sisusb->isopen) {
mutex_unlock(&sisusb->lock); mutex_unlock(&sisusb->lock);
unlock_kernel();
return -EBUSY; return -EBUSY;
} }
...@@ -2446,13 +2440,11 @@ sisusb_open(struct inode *inode, struct file *file) ...@@ -2446,13 +2440,11 @@ sisusb_open(struct inode *inode, struct file *file)
if (sisusb_init_gfxdevice(sisusb, 0)) { if (sisusb_init_gfxdevice(sisusb, 0)) {
mutex_unlock(&sisusb->lock); mutex_unlock(&sisusb->lock);
dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n"); dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n");
unlock_kernel();
return -EIO; return -EIO;
} }
} else { } else {
mutex_unlock(&sisusb->lock); mutex_unlock(&sisusb->lock);
dev_err(&sisusb->sisusb_dev->dev, "Device not attached to USB 2.0 hub\n"); dev_err(&sisusb->sisusb_dev->dev, "Device not attached to USB 2.0 hub\n");
unlock_kernel();
return -EIO; return -EIO;
} }
} }
...@@ -2465,7 +2457,6 @@ sisusb_open(struct inode *inode, struct file *file) ...@@ -2465,7 +2457,6 @@ sisusb_open(struct inode *inode, struct file *file)
file->private_data = sisusb; file->private_data = sisusb;
mutex_unlock(&sisusb->lock); mutex_unlock(&sisusb->lock);
unlock_kernel();
return 0; return 0;
} }
......
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