aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/kobil_sct.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-10-13 05:39:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 12:51:41 -0400
commit4a90f09b20f4622dcbff1f0e1e6bae1704f8ad8c (patch)
tree9b275f88f2705cb10121d5982741aef3a088a7c8 /drivers/usb/serial/kobil_sct.c
parent95f9bfc6b76e862265a2d70ae061eec18fe14140 (diff)
tty: usb-serial krefs
Use kref in the USB serial drivers so that we don't free tty structures from under the URB receive handlers as has historically been the case if you were unlucky. This also gives us a framework for general tty drivers to use tty_port objects and refcount. Contains two err->dev_err changes merged together to fix clashes in the -next tree. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb/serial/kobil_sct.c')
-rw-r--r--drivers/usb/serial/kobil_sct.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index deba28ec77e8..cfcf37c2b957 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -383,7 +383,7 @@ static void kobil_read_int_callback(struct urb *urb)
383 return; 383 return;
384 } 384 }
385 385
386 tty = port->port.tty; 386 tty = tty_port_tty_get(&port->port);
387 if (urb->actual_length) { 387 if (urb->actual_length) {
388 388
389 /* BEGIN DEBUG */ 389 /* BEGIN DEBUG */
@@ -405,6 +405,7 @@ static void kobil_read_int_callback(struct urb *urb)
405 tty_insert_flip_string(tty, data, urb->actual_length); 405 tty_insert_flip_string(tty, data, urb->actual_length);
406 tty_flip_buffer_push(tty); 406 tty_flip_buffer_push(tty);
407 } 407 }
408 tty_kref_put(tty);
408 /* someone sets the dev to 0 if the close method has been called */ 409 /* someone sets the dev to 0 if the close method has been called */
409 port->interrupt_in_urb->dev = port->serial->dev; 410 port->interrupt_in_urb->dev = port->serial->dev;
410 411