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/tty/serial/mfd.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/tty/serial/mfd.c')
-rw-r--r-- | drivers/tty/serial/mfd.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c index 60d585ab4870..5f4765a7a5c5 100644 --- a/drivers/tty/serial/mfd.c +++ b/drivers/tty/serial/mfd.c | |||
@@ -388,12 +388,8 @@ void hsu_dma_rx(struct uart_hsu_port *up, u32 int_sts) | |||
388 | struct hsu_dma_chan *chan = up->rxc; | 388 | struct hsu_dma_chan *chan = up->rxc; |
389 | struct uart_port *port = &up->port; | 389 | struct uart_port *port = &up->port; |
390 | struct tty_port *tport = &port->state->port; | 390 | struct tty_port *tport = &port->state->port; |
391 | struct tty_struct *tty = tport->tty; | ||
392 | int count; | 391 | int count; |
393 | 392 | ||
394 | if (!tty) | ||
395 | return; | ||
396 | |||
397 | /* | 393 | /* |
398 | * First need to know how many is already transferred, | 394 | * First need to know how many is already transferred, |
399 | * then check if its a timeout DMA irq, and return | 395 | * then check if its a timeout DMA irq, and return |
@@ -438,7 +434,7 @@ void hsu_dma_rx(struct uart_hsu_port *up, u32 int_sts) | |||
438 | | (0x1 << 16) | 434 | | (0x1 << 16) |
439 | | (0x1 << 24) /* timeout bit, see HSU Errata 1 */ | 435 | | (0x1 << 24) /* timeout bit, see HSU Errata 1 */ |
440 | ); | 436 | ); |
441 | tty_flip_buffer_push(tty); | 437 | tty_flip_buffer_push(tport); |
442 | 438 | ||
443 | chan_writel(chan, HSU_CH_CR, 0x3); | 439 | chan_writel(chan, HSU_CH_CR, 0x3); |
444 | 440 | ||
@@ -461,13 +457,9 @@ static void serial_hsu_stop_rx(struct uart_port *port) | |||
461 | 457 | ||
462 | static inline void receive_chars(struct uart_hsu_port *up, int *status) | 458 | static inline void receive_chars(struct uart_hsu_port *up, int *status) |
463 | { | 459 | { |
464 | struct tty_struct *tty = up->port.state->port.tty; | ||
465 | unsigned int ch, flag; | 460 | unsigned int ch, flag; |
466 | unsigned int max_count = 256; | 461 | unsigned int max_count = 256; |
467 | 462 | ||
468 | if (!tty) | ||
469 | return; | ||
470 | |||
471 | do { | 463 | do { |
472 | ch = serial_in(up, UART_RX); | 464 | ch = serial_in(up, UART_RX); |
473 | flag = TTY_NORMAL; | 465 | flag = TTY_NORMAL; |
@@ -523,7 +515,7 @@ static inline void receive_chars(struct uart_hsu_port *up, int *status) | |||
523 | ignore_char: | 515 | ignore_char: |
524 | *status = serial_in(up, UART_LSR); | 516 | *status = serial_in(up, UART_LSR); |
525 | } while ((*status & UART_LSR_DR) && max_count--); | 517 | } while ((*status & UART_LSR_DR) && max_count--); |
526 | tty_flip_buffer_push(tty); | 518 | tty_flip_buffer_push(&up->port.state->port); |
527 | } | 519 | } |
528 | 520 | ||
529 | static void transmit_chars(struct uart_hsu_port *up) | 521 | static void transmit_chars(struct uart_hsu_port *up) |