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/mmc | |
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/mmc')
-rw-r--r-- | drivers/mmc/card/sdio_uart.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/mmc/card/sdio_uart.c b/drivers/mmc/card/sdio_uart.c index 894078be0b96..c931dfe6a59c 100644 --- a/drivers/mmc/card/sdio_uart.c +++ b/drivers/mmc/card/sdio_uart.c | |||
@@ -381,7 +381,6 @@ static void sdio_uart_stop_rx(struct sdio_uart_port *port) | |||
381 | static void sdio_uart_receive_chars(struct sdio_uart_port *port, | 381 | static void sdio_uart_receive_chars(struct sdio_uart_port *port, |
382 | unsigned int *status) | 382 | unsigned int *status) |
383 | { | 383 | { |
384 | struct tty_struct *tty = tty_port_tty_get(&port->port); | ||
385 | unsigned int ch, flag; | 384 | unsigned int ch, flag; |
386 | int max_count = 256; | 385 | int max_count = 256; |
387 | 386 | ||
@@ -418,24 +417,19 @@ static void sdio_uart_receive_chars(struct sdio_uart_port *port, | |||
418 | } | 417 | } |
419 | 418 | ||
420 | if ((*status & port->ignore_status_mask & ~UART_LSR_OE) == 0) | 419 | if ((*status & port->ignore_status_mask & ~UART_LSR_OE) == 0) |
421 | if (tty) | 420 | tty_insert_flip_char(&port->port, ch, flag); |
422 | tty_insert_flip_char(&port->port, ch, flag); | ||
423 | 421 | ||
424 | /* | 422 | /* |
425 | * Overrun is special. Since it's reported immediately, | 423 | * Overrun is special. Since it's reported immediately, |
426 | * it doesn't affect the current character. | 424 | * it doesn't affect the current character. |
427 | */ | 425 | */ |
428 | if (*status & ~port->ignore_status_mask & UART_LSR_OE) | 426 | if (*status & ~port->ignore_status_mask & UART_LSR_OE) |
429 | if (tty) | 427 | tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); |
430 | tty_insert_flip_char(&port->port, 0, | ||
431 | TTY_OVERRUN); | ||
432 | 428 | ||
433 | *status = sdio_in(port, UART_LSR); | 429 | *status = sdio_in(port, UART_LSR); |
434 | } while ((*status & UART_LSR_DR) && (max_count-- > 0)); | 430 | } while ((*status & UART_LSR_DR) && (max_count-- > 0)); |
435 | if (tty) { | 431 | |
436 | tty_flip_buffer_push(tty); | 432 | tty_flip_buffer_push(&port->port); |
437 | tty_kref_put(tty); | ||
438 | } | ||
439 | } | 433 | } |
440 | 434 | ||
441 | static void sdio_uart_transmit_chars(struct sdio_uart_port *port) | 435 | static void sdio_uart_transmit_chars(struct sdio_uart_port *port) |