diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2015-07-27 18:09:33 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-04 22:07:20 -0700 |
commit | 7d07ada047a4e1f5ff98757ce34c0fdd13d8ec93 (patch) | |
tree | 5a73a17f99e11932ffcde80217ee98d7d6648330 | |
parent | 7b9c5162c1829686baea1962177842c3fa1ea81c (diff) | |
download | linux-stable-7d07ada047a4e1f5ff98757ce34c0fdd13d8ec93.tar.gz linux-stable-7d07ada047a4e1f5ff98757ce34c0fdd13d8ec93.tar.bz2 linux-stable-7d07ada047a4e1f5ff98757ce34c0fdd13d8ec93.zip |
serial: mpc52xx: let tx_empty callback return either 0 or TIOCSER_TEMT
Documenation/serial/driver requests that the tx_empty callback should
return 0 if there are still chars in the fifo or shifter or TIOCSER_TEMT
(0x01) if no character is pending to be sent.
Fix the mpc52xx serial driver to not return MPC52xx_PSC_SR_TXEMP (i.e.
0x0800) but TIOCSER_TEMT as documented.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/mpc52xx_uart.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c index 6fc07eb9d74e..41de374d9784 100644 --- a/drivers/tty/serial/mpc52xx_uart.c +++ b/drivers/tty/serial/mpc52xx_uart.c @@ -239,8 +239,9 @@ static int mpc52xx_psc_tx_rdy(struct uart_port *port) static int mpc52xx_psc_tx_empty(struct uart_port *port) { - return in_be16(&PSC(port)->mpc52xx_psc_status) - & MPC52xx_PSC_SR_TXEMP; + u16 sts = in_be16(&PSC(port)->mpc52xx_psc_status); + + return (sts & MPC52xx_PSC_SR_TXEMP) ? TIOCSER_TEMT : 0; } static void mpc52xx_psc_start_tx(struct uart_port *port) |