diff options
Diffstat (limited to 'drivers/usb/misc/sisusbvga/sisusb.c')
-rw-r--r-- | drivers/usb/misc/sisusbvga/sisusb.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 0025847743f3..aae95a009bd5 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c | |||
@@ -250,7 +250,7 @@ sisusb_bulkout_msg(struct sisusb_usb_data *sisusb, int index, unsigned int pipe, | |||
250 | sisusb->urbstatus[index] |= SU_URB_BUSY; | 250 | sisusb->urbstatus[index] |= SU_URB_BUSY; |
251 | 251 | ||
252 | /* Submit URB */ | 252 | /* Submit URB */ |
253 | retval = usb_submit_urb(urb, GFP_ATOMIC); | 253 | retval = usb_submit_urb(urb, GFP_KERNEL); |
254 | 254 | ||
255 | /* If OK, and if timeout > 0, wait for completion */ | 255 | /* If OK, and if timeout > 0, wait for completion */ |
256 | if ((retval == 0) && timeout) { | 256 | if ((retval == 0) && timeout) { |
@@ -306,7 +306,7 @@ sisusb_bulkin_msg(struct sisusb_usb_data *sisusb, unsigned int pipe, void *data, | |||
306 | urb->actual_length = 0; | 306 | urb->actual_length = 0; |
307 | 307 | ||
308 | sisusb->completein = 0; | 308 | sisusb->completein = 0; |
309 | retval = usb_submit_urb(urb, GFP_ATOMIC); | 309 | retval = usb_submit_urb(urb, GFP_KERNEL); |
310 | if (retval == 0) { | 310 | if (retval == 0) { |
311 | wait_event_timeout(sisusb->wait_q, sisusb->completein, timeout); | 311 | wait_event_timeout(sisusb->wait_q, sisusb->completein, timeout); |
312 | if (!sisusb->completein) { | 312 | if (!sisusb->completein) { |
@@ -2416,21 +2416,28 @@ sisusb_open(struct inode *inode, struct file *file) | |||
2416 | struct usb_interface *interface; | 2416 | struct usb_interface *interface; |
2417 | int subminor = iminor(inode); | 2417 | int subminor = iminor(inode); |
2418 | 2418 | ||
2419 | if (!(interface = usb_find_interface(&sisusb_driver, subminor))) | 2419 | lock_kernel(); |
2420 | if (!(interface = usb_find_interface(&sisusb_driver, subminor))) { | ||
2421 | unlock_kernel(); | ||
2420 | return -ENODEV; | 2422 | return -ENODEV; |
2423 | } | ||
2421 | 2424 | ||
2422 | if (!(sisusb = usb_get_intfdata(interface))) | 2425 | if (!(sisusb = usb_get_intfdata(interface))) { |
2426 | unlock_kernel(); | ||
2423 | return -ENODEV; | 2427 | return -ENODEV; |
2428 | } | ||
2424 | 2429 | ||
2425 | mutex_lock(&sisusb->lock); | 2430 | mutex_lock(&sisusb->lock); |
2426 | 2431 | ||
2427 | if (!sisusb->present || !sisusb->ready) { | 2432 | if (!sisusb->present || !sisusb->ready) { |
2428 | mutex_unlock(&sisusb->lock); | 2433 | mutex_unlock(&sisusb->lock); |
2434 | unlock_kernel(); | ||
2429 | return -ENODEV; | 2435 | return -ENODEV; |
2430 | } | 2436 | } |
2431 | 2437 | ||
2432 | if (sisusb->isopen) { | 2438 | if (sisusb->isopen) { |
2433 | mutex_unlock(&sisusb->lock); | 2439 | mutex_unlock(&sisusb->lock); |
2440 | unlock_kernel(); | ||
2434 | return -EBUSY; | 2441 | return -EBUSY; |
2435 | } | 2442 | } |
2436 | 2443 | ||
@@ -2439,11 +2446,13 @@ sisusb_open(struct inode *inode, struct file *file) | |||
2439 | if (sisusb_init_gfxdevice(sisusb, 0)) { | 2446 | if (sisusb_init_gfxdevice(sisusb, 0)) { |
2440 | mutex_unlock(&sisusb->lock); | 2447 | mutex_unlock(&sisusb->lock); |
2441 | dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n"); | 2448 | dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n"); |
2449 | unlock_kernel(); | ||
2442 | return -EIO; | 2450 | return -EIO; |
2443 | } | 2451 | } |
2444 | } else { | 2452 | } else { |
2445 | mutex_unlock(&sisusb->lock); | 2453 | mutex_unlock(&sisusb->lock); |
2446 | dev_err(&sisusb->sisusb_dev->dev, "Device not attached to USB 2.0 hub\n"); | 2454 | dev_err(&sisusb->sisusb_dev->dev, "Device not attached to USB 2.0 hub\n"); |
2455 | unlock_kernel(); | ||
2447 | return -EIO; | 2456 | return -EIO; |
2448 | } | 2457 | } |
2449 | } | 2458 | } |
@@ -2456,6 +2465,7 @@ sisusb_open(struct inode *inode, struct file *file) | |||
2456 | file->private_data = sisusb; | 2465 | file->private_data = sisusb; |
2457 | 2466 | ||
2458 | mutex_unlock(&sisusb->lock); | 2467 | mutex_unlock(&sisusb->lock); |
2468 | unlock_kernel(); | ||
2459 | 2469 | ||
2460 | return 0; | 2470 | return 0; |
2461 | } | 2471 | } |
@@ -3238,13 +3248,14 @@ static void sisusb_disconnect(struct usb_interface *intf) | |||
3238 | kref_put(&sisusb->kref, sisusb_delete); | 3248 | kref_put(&sisusb->kref, sisusb_delete); |
3239 | } | 3249 | } |
3240 | 3250 | ||
3241 | static struct usb_device_id sisusb_table [] = { | 3251 | static const struct usb_device_id sisusb_table[] = { |
3242 | { USB_DEVICE(0x0711, 0x0550) }, | 3252 | { USB_DEVICE(0x0711, 0x0550) }, |
3243 | { USB_DEVICE(0x0711, 0x0900) }, | 3253 | { USB_DEVICE(0x0711, 0x0900) }, |
3244 | { USB_DEVICE(0x0711, 0x0901) }, | 3254 | { USB_DEVICE(0x0711, 0x0901) }, |
3245 | { USB_DEVICE(0x0711, 0x0902) }, | 3255 | { USB_DEVICE(0x0711, 0x0902) }, |
3246 | { USB_DEVICE(0x0711, 0x0903) }, | 3256 | { USB_DEVICE(0x0711, 0x0903) }, |
3247 | { USB_DEVICE(0x0711, 0x0918) }, | 3257 | { USB_DEVICE(0x0711, 0x0918) }, |
3258 | { USB_DEVICE(0x0711, 0x0920) }, | ||
3248 | { USB_DEVICE(0x182d, 0x021c) }, | 3259 | { USB_DEVICE(0x182d, 0x021c) }, |
3249 | { USB_DEVICE(0x182d, 0x0269) }, | 3260 | { USB_DEVICE(0x182d, 0x0269) }, |
3250 | { } | 3261 | { } |