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/spcp8x5.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/spcp8x5.c')
-rw-r--r-- | drivers/usb/serial/spcp8x5.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c index 04e373152724..91ff8e3bddbd 100644 --- a/drivers/usb/serial/spcp8x5.c +++ b/drivers/usb/serial/spcp8x5.c | |||
@@ -462,7 +462,6 @@ static void spcp8x5_process_read_urb(struct urb *urb) | |||
462 | { | 462 | { |
463 | struct usb_serial_port *port = urb->context; | 463 | struct usb_serial_port *port = urb->context; |
464 | struct spcp8x5_private *priv = usb_get_serial_port_data(port); | 464 | struct spcp8x5_private *priv = usb_get_serial_port_data(port); |
465 | struct tty_struct *tty; | ||
466 | unsigned char *data = urb->transfer_buffer; | 465 | unsigned char *data = urb->transfer_buffer; |
467 | unsigned long flags; | 466 | unsigned long flags; |
468 | u8 status; | 467 | u8 status; |
@@ -481,9 +480,6 @@ static void spcp8x5_process_read_urb(struct urb *urb) | |||
481 | if (!urb->actual_length) | 480 | if (!urb->actual_length) |
482 | return; | 481 | return; |
483 | 482 | ||
484 | tty = tty_port_tty_get(&port->port); | ||
485 | if (!tty) | ||
486 | return; | ||
487 | 483 | ||
488 | if (status & UART_STATE_TRANSIENT_MASK) { | 484 | if (status & UART_STATE_TRANSIENT_MASK) { |
489 | /* break takes precedence over parity, which takes precedence | 485 | /* break takes precedence over parity, which takes precedence |
@@ -500,15 +496,19 @@ static void spcp8x5_process_read_urb(struct urb *urb) | |||
500 | if (status & UART_OVERRUN_ERROR) | 496 | if (status & UART_OVERRUN_ERROR) |
501 | tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); | 497 | tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); |
502 | 498 | ||
503 | if (status & UART_DCD) | 499 | if (status & UART_DCD) { |
504 | usb_serial_handle_dcd_change(port, tty, | 500 | struct tty_struct *tty = tty_port_tty_get(&port->port); |
505 | priv->line_status & MSR_STATUS_LINE_DCD); | 501 | if (tty) { |
502 | usb_serial_handle_dcd_change(port, tty, | ||
503 | priv->line_status & MSR_STATUS_LINE_DCD); | ||
504 | tty_kref_put(tty); | ||
505 | } | ||
506 | } | ||
506 | } | 507 | } |
507 | 508 | ||
508 | tty_insert_flip_string_fixed_flag(&port->port, data, tty_flag, | 509 | tty_insert_flip_string_fixed_flag(&port->port, data, tty_flag, |
509 | urb->actual_length); | 510 | urb->actual_length); |
510 | tty_flip_buffer_push(tty); | 511 | tty_flip_buffer_push(&port->port); |
511 | tty_kref_put(tty); | ||
512 | } | 512 | } |
513 | 513 | ||
514 | static int spcp8x5_wait_modem_info(struct usb_serial_port *port, | 514 | static int spcp8x5_wait_modem_info(struct usb_serial_port *port, |