[PATCH] Fix logic of tx_empty.

Simon Budig simon at budig.de
Fri Jul 22 07:07:42 EDT 2011


   test for TX-FIFO *not empty* instead of TX-FIFO full.

Signed-off-by: Simon Budig <simon.budig at kernelconcepts.de>
---
 drivers/tty/serial/amba-pl011.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 05eb292..a23b419 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -792,7 +792,7 @@ static unsigned int pl01x_tx_empty(struct uart_port *port)
 {
 	struct uart_amba_port *uap = (struct uart_amba_port *)port;
 	unsigned int status = readw(uap->port.membase + UART01x_FR);
-	return status & (UART01x_FR_BUSY|UART01x_FR_TXFF) ? 0 : TIOCSER_TEMT;
+	return (status & UART01x_FR_BUSY) || !(status & UART011_FR_TXFE) ? 0 : TIOCSER_TEMT;
 }
 
 static unsigned int pl01x_get_mctrl(struct uart_port *port)
-- 
1.7.0.4



--------------060708010803060308030706--



More information about the linux-arm-kernel mailing list