aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/empeg.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/empeg.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/empeg.c')
-rw-r--r--drivers/usb/serial/empeg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
index a6ab5b58d9ca..1072e847280f 100644
--- a/drivers/usb/serial/empeg.c
+++ b/drivers/usb/serial/empeg.c
@@ -33,9 +33,8 @@
33 * Moved MOD_DEC_USE_COUNT to end of empeg_close(). 33 * Moved MOD_DEC_USE_COUNT to end of empeg_close().
34 * 34 *
35 * (12/03/2000) gb 35 * (12/03/2000) gb
36 * Added port->port.tty->ldisc.set_termios(port->port.tty, NULL) to 36 * Added tty->ldisc.set_termios(port, tty, NULL) to empeg_open().
37 * empeg_open(). This notifies the tty driver that the termios have 37 * This notifies the tty driver that the termios have changed.
38 * changed.
39 * 38 *
40 * (11/13/2000) gb 39 * (11/13/2000) gb
41 * Moved tty->low_latency = 1 from empeg_read_bulk_callback() to 40 * Moved tty->low_latency = 1 from empeg_read_bulk_callback() to
@@ -354,7 +353,7 @@ static void empeg_read_bulk_callback(struct urb *urb)
354 353
355 usb_serial_debug_data(debug, &port->dev, __func__, 354 usb_serial_debug_data(debug, &port->dev, __func__,
356 urb->actual_length, data); 355 urb->actual_length, data);
357 tty = port->port.tty; 356 tty = tty_port_tty_get(&port->port);
358 357
359 if (urb->actual_length) { 358 if (urb->actual_length) {
360 tty_buffer_request_room(tty, urb->actual_length); 359 tty_buffer_request_room(tty, urb->actual_length);
@@ -362,6 +361,7 @@ static void empeg_read_bulk_callback(struct urb *urb)
362 tty_flip_buffer_push(tty); 361 tty_flip_buffer_push(tty);
363 bytes_in += urb->actual_length; 362 bytes_in += urb->actual_length;
364 } 363 }
364 tty_kref_put(tty);
365 365
366 /* Continue trying to always read */ 366 /* Continue trying to always read */
367 usb_fill_bulk_urb( 367 usb_fill_bulk_urb(