X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=drivers%2Fserial%2Fsunsu.c;fp=drivers%2Fserial%2Fsunsu.c;h=0cc879eb1c02e36fa53dc057eff22d25a5f7c7be;hb=b129a8ccd53f74c43e4c83c8e0031a4990040830;hp=d57a3553aea359ac7a3123ae62261f2ed9abbb0d;hpb=6b39374a27eb4be7e9d82145ae270ba02ea90dc8;p=cascardo%2Flinux.git diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index d57a3553aea3..0cc879eb1c02 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c @@ -255,21 +255,27 @@ static void disable_rsa(struct uart_sunsu_port *up) } #endif /* CONFIG_SERIAL_8250_RSA */ -static void sunsu_stop_tx(struct uart_port *port, unsigned int tty_stop) +static inline void __stop_tx(struct uart_sunsu_port *p) +{ + if (p->ier & UART_IER_THRI) { + p->ier &= ~UART_IER_THRI; + serial_out(p, UART_IER, p->ier); + } +} + +static void sunsu_stop_tx(struct uart_port *port) { struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; - if (up->ier & UART_IER_THRI) { - up->ier &= ~UART_IER_THRI; - serial_out(up, UART_IER, up->ier); - } - if (up->port.type == PORT_16C950 && tty_stop) { + __stop_tx(up); + + if (up->port.type == PORT_16C950 && tty_stop /*FIXME*/) { up->acr |= UART_ACR_TXDIS; serial_icr_write(up, UART_ACR, up->acr); } } -static void sunsu_start_tx(struct uart_port *port, unsigned int tty_start) +static void sunsu_start_tx(struct uart_port *port) { struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; @@ -280,7 +286,7 @@ static void sunsu_start_tx(struct uart_port *port, unsigned int tty_start) /* * We only do this from uart_start */ - if (tty_start && up->port.type == PORT_16C950) { + if (tty_start && up->port.type == PORT_16C950 /*FIXME*/) { up->acr &= ~UART_ACR_TXDIS; serial_icr_write(up, UART_ACR, up->acr); } @@ -413,8 +419,12 @@ static _INLINE_ void transmit_chars(struct uart_sunsu_port *up) up->port.x_char = 0; return; } - if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { - sunsu_stop_tx(&up->port, 0); + if (uart_tx_stopped(&up->port)) { + sunsu_stop_tx(&up->port); + return; + } + if (uart_circ_empty(xmit)) { + __stop_tx(up); return; } @@ -431,7 +441,7 @@ static _INLINE_ void transmit_chars(struct uart_sunsu_port *up) uart_write_wakeup(&up->port); if (uart_circ_empty(xmit)) - sunsu_stop_tx(&up->port, 0); + __stop_tx(up); } static _INLINE_ void check_modem_status(struct uart_sunsu_port *up)