diff options
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 6f5a0720a8c8..763eb20fe321 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c | |||
@@ -1249,20 +1249,19 @@ __acquires(&uap->port.lock) | |||
1249 | 1249 | ||
1250 | /* | 1250 | /* |
1251 | * Transmit a character | 1251 | * Transmit a character |
1252 | * There must be at least one free entry in the TX FIFO to accept the char. | ||
1253 | * | 1252 | * |
1254 | * Returns true if the FIFO might have space in it afterwards; | 1253 | * Returns true if the character was successfully queued to the FIFO. |
1255 | * returns false if the FIFO definitely became full. | 1254 | * Returns false otherwise. |
1256 | */ | 1255 | */ |
1257 | static bool pl011_tx_char(struct uart_amba_port *uap, unsigned char c) | 1256 | static bool pl011_tx_char(struct uart_amba_port *uap, unsigned char c) |
1258 | { | 1257 | { |
1258 | if (readw(uap->port.membase + UART01x_FR) & UART01x_FR_TXFF) | ||
1259 | return false; /* unable to transmit character */ | ||
1260 | |||
1259 | writew(c, uap->port.membase + UART01x_DR); | 1261 | writew(c, uap->port.membase + UART01x_DR); |
1260 | uap->port.icount.tx++; | 1262 | uap->port.icount.tx++; |
1261 | 1263 | ||
1262 | if (likely(uap->tx_irq_seen > 1)) | 1264 | return true; |
1263 | return true; | ||
1264 | |||
1265 | return !(readw(uap->port.membase + UART01x_FR) & UART01x_FR_TXFF); | ||
1266 | } | 1265 | } |
1267 | 1266 | ||
1268 | static bool pl011_tx_chars(struct uart_amba_port *uap) | 1267 | static bool pl011_tx_chars(struct uart_amba_port *uap) |
@@ -1296,7 +1295,8 @@ static bool pl011_tx_chars(struct uart_amba_port *uap) | |||
1296 | return false; | 1295 | return false; |
1297 | 1296 | ||
1298 | if (uap->port.x_char) { | 1297 | if (uap->port.x_char) { |
1299 | pl011_tx_char(uap, uap->port.x_char); | 1298 | if (!pl011_tx_char(uap, uap->port.x_char)) |
1299 | goto done; | ||
1300 | uap->port.x_char = 0; | 1300 | uap->port.x_char = 0; |
1301 | --count; | 1301 | --count; |
1302 | } | 1302 | } |