diff options
author | Jiri Slaby <jslaby@suse.cz> | 2013-01-03 09:53:06 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-16 01:30:15 -0500 |
commit | 2e124b4a390ca85325fae75764bef92f0547fa25 (patch) | |
tree | 5519fbcdbe954e79b271ea6d31ac5a4dc754c4f5 /drivers/usb/serial/mct_u232.c | |
parent | d6c53c0e9bd0a83f9f9ddbc9fd80141a54d83896 (diff) |
TTY: switch tty_flip_buffer_push
Now, we start converting tty buffer functions to actually use
tty_port. This will allow us to get rid of the need of tty in many
call sites. Only tty_port will needed and hence no more
tty_port_tty_get in those paths.
Now, the one where most of tty_port_tty_get gets removed:
tty_flip_buffer_push.
IOW we also closed all the races in drivers not using tty_port_tty_get
at all yet.
Also we move tty_flip_buffer_push declaration from include/linux/tty.h
to include/linux/tty_flip.h to all others while we are changing it
anyway.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/mct_u232.c')
-rw-r--r-- | drivers/usb/serial/mct_u232.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index ba20bb037b28..f42528e05d7b 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c | |||
@@ -531,7 +531,6 @@ static void mct_u232_read_int_callback(struct urb *urb) | |||
531 | { | 531 | { |
532 | struct usb_serial_port *port = urb->context; | 532 | struct usb_serial_port *port = urb->context; |
533 | struct mct_u232_private *priv = usb_get_serial_port_data(port); | 533 | struct mct_u232_private *priv = usb_get_serial_port_data(port); |
534 | struct tty_struct *tty; | ||
535 | unsigned char *data = urb->transfer_buffer; | 534 | unsigned char *data = urb->transfer_buffer; |
536 | int retval; | 535 | int retval; |
537 | int status = urb->status; | 536 | int status = urb->status; |
@@ -561,13 +560,9 @@ static void mct_u232_read_int_callback(struct urb *urb) | |||
561 | */ | 560 | */ |
562 | if (urb->transfer_buffer_length > 2) { | 561 | if (urb->transfer_buffer_length > 2) { |
563 | if (urb->actual_length) { | 562 | if (urb->actual_length) { |
564 | tty = tty_port_tty_get(&port->port); | 563 | tty_insert_flip_string(&port->port, data, |
565 | if (tty) { | 564 | urb->actual_length); |
566 | tty_insert_flip_string(&port->port, data, | 565 | tty_flip_buffer_push(&port->port); |
567 | urb->actual_length); | ||
568 | tty_flip_buffer_push(tty); | ||
569 | } | ||
570 | tty_kref_put(tty); | ||
571 | } | 566 | } |
572 | goto exit; | 567 | goto exit; |
573 | } | 568 | } |