diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-03 11:48:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-03 11:48:58 -0500 |
commit | 7f5b09c15ab989ed5ce4adda0be42c1302df70b7 (patch) | |
tree | 9695b00983d1bd077ff91c463abcb136330cf344 /drivers/usb/misc/rio500.c | |
parent | 94468080220162f74dc6ce5c3e95e5fec8022902 (diff) | |
parent | cedf8a78421943441b9011ce7bcdab55f07d2ea6 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (220 commits)
USB: backlight, appledisplay: fix incomplete registration failure handling
USB: pl2303: remove unnecessary reset of usb_device in urbs
USB: ftdi_sio: remove obsolete check in unthrottle
USB: ftdi_sio: remove unused tx_bytes counter
USB: qcaux: driver for auxiliary serial ports on Qualcomm devices
USB: pl2303: initial TIOCGSERIAL support
USB: option: add Longcheer/Longsung vendor ID
USB: fix I2C API usage in ohci-pnx4008.
USB: usbmon: mask seconds properly in text API
USB: sisusbvga: no unnecessary GFP_ATOMIC
USB: storage: onetouch: unnecessary GFP_ATOMIC
USB: serial: ftdi: add CONTEC vendor and product id
USB: remove references to port->port.count from the serial drivers
USB: tty: Prune uses of tty_request_room in the USB layer
USB: tty: Add a function to insert a string of characters with the same flag
USB: don't read past config->interface[] if usb_control_msg() fails in usb_reset_configuration()
USB: tty: kill request_room for USB ACM class
USB: tty: sort out the request_room handling for whiteheat
USB: storage: fix misplaced parenthesis
USB: vstusb.c: removal of driver for Vernier Software & Technology, Inc., devices and spectrometers
...
Diffstat (limited to 'drivers/usb/misc/rio500.c')
-rw-r--r-- | drivers/usb/misc/rio500.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c index 32d0199d0c32..a85771b1563d 100644 --- a/drivers/usb/misc/rio500.c +++ b/drivers/usb/misc/rio500.c | |||
@@ -78,10 +78,13 @@ static int open_rio(struct inode *inode, struct file *file) | |||
78 | { | 78 | { |
79 | struct rio_usb_data *rio = &rio_instance; | 79 | struct rio_usb_data *rio = &rio_instance; |
80 | 80 | ||
81 | /* against disconnect() */ | ||
82 | lock_kernel(); | ||
81 | mutex_lock(&(rio->lock)); | 83 | mutex_lock(&(rio->lock)); |
82 | 84 | ||
83 | if (rio->isopen || !rio->present) { | 85 | if (rio->isopen || !rio->present) { |
84 | mutex_unlock(&(rio->lock)); | 86 | mutex_unlock(&(rio->lock)); |
87 | unlock_kernel(); | ||
85 | return -EBUSY; | 88 | return -EBUSY; |
86 | } | 89 | } |
87 | rio->isopen = 1; | 90 | rio->isopen = 1; |
@@ -91,6 +94,7 @@ static int open_rio(struct inode *inode, struct file *file) | |||
91 | mutex_unlock(&(rio->lock)); | 94 | mutex_unlock(&(rio->lock)); |
92 | 95 | ||
93 | dev_info(&rio->rio_dev->dev, "Rio opened.\n"); | 96 | dev_info(&rio->rio_dev->dev, "Rio opened.\n"); |
97 | unlock_kernel(); | ||
94 | 98 | ||
95 | return 0; | 99 | return 0; |
96 | } | 100 | } |
@@ -115,7 +119,6 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg) | |||
115 | int retries; | 119 | int retries; |
116 | int retval=0; | 120 | int retval=0; |
117 | 121 | ||
118 | lock_kernel(); | ||
119 | mutex_lock(&(rio->lock)); | 122 | mutex_lock(&(rio->lock)); |
120 | /* Sanity check to make sure rio is connected, powered, etc */ | 123 | /* Sanity check to make sure rio is connected, powered, etc */ |
121 | if (rio->present == 0 || rio->rio_dev == NULL) { | 124 | if (rio->present == 0 || rio->rio_dev == NULL) { |
@@ -254,7 +257,6 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg) | |||
254 | 257 | ||
255 | err_out: | 258 | err_out: |
256 | mutex_unlock(&(rio->lock)); | 259 | mutex_unlock(&(rio->lock)); |
257 | unlock_kernel(); | ||
258 | return retval; | 260 | return retval; |
259 | } | 261 | } |
260 | 262 | ||
@@ -489,6 +491,7 @@ static void disconnect_rio(struct usb_interface *intf) | |||
489 | struct rio_usb_data *rio = usb_get_intfdata (intf); | 491 | struct rio_usb_data *rio = usb_get_intfdata (intf); |
490 | 492 | ||
491 | usb_set_intfdata (intf, NULL); | 493 | usb_set_intfdata (intf, NULL); |
494 | lock_kernel(); | ||
492 | if (rio) { | 495 | if (rio) { |
493 | usb_deregister_dev(intf, &usb_rio_class); | 496 | usb_deregister_dev(intf, &usb_rio_class); |
494 | 497 | ||
@@ -498,6 +501,7 @@ static void disconnect_rio(struct usb_interface *intf) | |||
498 | /* better let it finish - the release will do whats needed */ | 501 | /* better let it finish - the release will do whats needed */ |
499 | rio->rio_dev = NULL; | 502 | rio->rio_dev = NULL; |
500 | mutex_unlock(&(rio->lock)); | 503 | mutex_unlock(&(rio->lock)); |
504 | unlock_kernel(); | ||
501 | return; | 505 | return; |
502 | } | 506 | } |
503 | kfree(rio->ibuf); | 507 | kfree(rio->ibuf); |
@@ -508,9 +512,10 @@ static void disconnect_rio(struct usb_interface *intf) | |||
508 | rio->present = 0; | 512 | rio->present = 0; |
509 | mutex_unlock(&(rio->lock)); | 513 | mutex_unlock(&(rio->lock)); |
510 | } | 514 | } |
515 | unlock_kernel(); | ||
511 | } | 516 | } |
512 | 517 | ||
513 | static struct usb_device_id rio_table [] = { | 518 | static const struct usb_device_id rio_table[] = { |
514 | { USB_DEVICE(0x0841, 1) }, /* Rio 500 */ | 519 | { USB_DEVICE(0x0841, 1) }, /* Rio 500 */ |
515 | { } /* Terminating entry */ | 520 | { } /* Terminating entry */ |
516 | }; | 521 | }; |