diff options
Diffstat (limited to 'drivers/serial/imx.c')
-rw-r--r-- | drivers/serial/imx.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index 66ecc7ab6dab..dfcf4b1878aa 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
@@ -327,14 +327,13 @@ static inline void imx_transmit_buffer(struct imx_port *sport) | |||
327 | { | 327 | { |
328 | struct circ_buf *xmit = &sport->port.state->xmit; | 328 | struct circ_buf *xmit = &sport->port.state->xmit; |
329 | 329 | ||
330 | while (!(readl(sport->port.membase + UTS) & UTS_TXFULL)) { | 330 | while (!uart_circ_empty(xmit) && |
331 | !(readl(sport->port.membase + UTS) & UTS_TXFULL)) { | ||
331 | /* send xmit->buf[xmit->tail] | 332 | /* send xmit->buf[xmit->tail] |
332 | * out the port here */ | 333 | * out the port here */ |
333 | writel(xmit->buf[xmit->tail], sport->port.membase + URTX0); | 334 | writel(xmit->buf[xmit->tail], sport->port.membase + URTX0); |
334 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); | 335 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); |
335 | sport->port.icount.tx++; | 336 | sport->port.icount.tx++; |
336 | if (uart_circ_empty(xmit)) | ||
337 | break; | ||
338 | } | 337 | } |
339 | 338 | ||
340 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) | 339 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |