diff options
Diffstat (limited to 'drivers/usb/misc/sisusbvga/sisusb.c')
-rw-r--r-- | drivers/usb/misc/sisusbvga/sisusb.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index aae95a009bd5..30d930386b65 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c | |||
@@ -47,7 +47,6 @@ | |||
47 | #include <linux/spinlock.h> | 47 | #include <linux/spinlock.h> |
48 | #include <linux/kref.h> | 48 | #include <linux/kref.h> |
49 | #include <linux/usb.h> | 49 | #include <linux/usb.h> |
50 | #include <linux/smp_lock.h> | ||
51 | #include <linux/vmalloc.h> | 50 | #include <linux/vmalloc.h> |
52 | 51 | ||
53 | #include "sisusb.h" | 52 | #include "sisusb.h" |
@@ -2416,14 +2415,11 @@ sisusb_open(struct inode *inode, struct file *file) | |||
2416 | struct usb_interface *interface; | 2415 | struct usb_interface *interface; |
2417 | int subminor = iminor(inode); | 2416 | int subminor = iminor(inode); |
2418 | 2417 | ||
2419 | lock_kernel(); | ||
2420 | if (!(interface = usb_find_interface(&sisusb_driver, subminor))) { | 2418 | if (!(interface = usb_find_interface(&sisusb_driver, subminor))) { |
2421 | unlock_kernel(); | ||
2422 | return -ENODEV; | 2419 | return -ENODEV; |
2423 | } | 2420 | } |
2424 | 2421 | ||
2425 | if (!(sisusb = usb_get_intfdata(interface))) { | 2422 | if (!(sisusb = usb_get_intfdata(interface))) { |
2426 | unlock_kernel(); | ||
2427 | return -ENODEV; | 2423 | return -ENODEV; |
2428 | } | 2424 | } |
2429 | 2425 | ||
@@ -2431,13 +2427,11 @@ sisusb_open(struct inode *inode, struct file *file) | |||
2431 | 2427 | ||
2432 | if (!sisusb->present || !sisusb->ready) { | 2428 | if (!sisusb->present || !sisusb->ready) { |
2433 | mutex_unlock(&sisusb->lock); | 2429 | mutex_unlock(&sisusb->lock); |
2434 | unlock_kernel(); | ||
2435 | return -ENODEV; | 2430 | return -ENODEV; |
2436 | } | 2431 | } |
2437 | 2432 | ||
2438 | if (sisusb->isopen) { | 2433 | if (sisusb->isopen) { |
2439 | mutex_unlock(&sisusb->lock); | 2434 | mutex_unlock(&sisusb->lock); |
2440 | unlock_kernel(); | ||
2441 | return -EBUSY; | 2435 | return -EBUSY; |
2442 | } | 2436 | } |
2443 | 2437 | ||
@@ -2446,13 +2440,11 @@ sisusb_open(struct inode *inode, struct file *file) | |||
2446 | if (sisusb_init_gfxdevice(sisusb, 0)) { | 2440 | if (sisusb_init_gfxdevice(sisusb, 0)) { |
2447 | mutex_unlock(&sisusb->lock); | 2441 | mutex_unlock(&sisusb->lock); |
2448 | dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n"); | 2442 | dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n"); |
2449 | unlock_kernel(); | ||
2450 | return -EIO; | 2443 | return -EIO; |
2451 | } | 2444 | } |
2452 | } else { | 2445 | } else { |
2453 | mutex_unlock(&sisusb->lock); | 2446 | mutex_unlock(&sisusb->lock); |
2454 | dev_err(&sisusb->sisusb_dev->dev, "Device not attached to USB 2.0 hub\n"); | 2447 | dev_err(&sisusb->sisusb_dev->dev, "Device not attached to USB 2.0 hub\n"); |
2455 | unlock_kernel(); | ||
2456 | return -EIO; | 2448 | return -EIO; |
2457 | } | 2449 | } |
2458 | } | 2450 | } |
@@ -2465,7 +2457,6 @@ sisusb_open(struct inode *inode, struct file *file) | |||
2465 | file->private_data = sisusb; | 2457 | file->private_data = sisusb; |
2466 | 2458 | ||
2467 | mutex_unlock(&sisusb->lock); | 2459 | mutex_unlock(&sisusb->lock); |
2468 | unlock_kernel(); | ||
2469 | 2460 | ||
2470 | return 0; | 2461 | return 0; |
2471 | } | 2462 | } |
@@ -2974,13 +2965,12 @@ sisusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
2974 | struct sisusb_usb_data *sisusb; | 2965 | struct sisusb_usb_data *sisusb; |
2975 | struct sisusb_info x; | 2966 | struct sisusb_info x; |
2976 | struct sisusb_command y; | 2967 | struct sisusb_command y; |
2977 | int retval = 0; | 2968 | long retval = 0; |
2978 | u32 __user *argp = (u32 __user *)arg; | 2969 | u32 __user *argp = (u32 __user *)arg; |
2979 | 2970 | ||
2980 | if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) | 2971 | if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) |
2981 | return -ENODEV; | 2972 | return -ENODEV; |
2982 | 2973 | ||
2983 | lock_kernel(); | ||
2984 | mutex_lock(&sisusb->lock); | 2974 | mutex_lock(&sisusb->lock); |
2985 | 2975 | ||
2986 | /* Sanity check */ | 2976 | /* Sanity check */ |
@@ -3039,7 +3029,6 @@ sisusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
3039 | 3029 | ||
3040 | err_out: | 3030 | err_out: |
3041 | mutex_unlock(&sisusb->lock); | 3031 | mutex_unlock(&sisusb->lock); |
3042 | unlock_kernel(); | ||
3043 | return retval; | 3032 | return retval; |
3044 | } | 3033 | } |
3045 | 3034 | ||