aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorDirk Behme <dirk.behme@de.bosch.com>2014-12-09 04:11:25 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-09 17:23:07 -0500
commit7942f8577f2a63b7a6b8cd70f5354a608b30fead (patch)
treecb5e85c0fd9e2d79af66930f73ae2f91082e81b4 /drivers/tty/serial
parent55c3cb1358e57280c54e3578afc76ce8190dd087 (diff)
serial: imx: TX DMA: clean up sg initialization
Inverting the logic of the if statement for the sg initialization makes the if statement easier and better to read. No functional change. Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/imx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 146663c100fd..5cea7d257426 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -539,15 +539,15 @@ static void imx_dma_tx(struct imx_port *sport)
539 539
540 sport->tx_bytes = uart_circ_chars_pending(xmit); 540 sport->tx_bytes = uart_circ_chars_pending(xmit);
541 541
542 if (xmit->tail > xmit->head && xmit->head > 0) { 542 if (xmit->tail < xmit->head) {
543 sport->dma_tx_nents = 1;
544 sg_init_one(sgl, xmit->buf + xmit->tail, sport->tx_bytes);
545 } else {
543 sport->dma_tx_nents = 2; 546 sport->dma_tx_nents = 2;
544 sg_init_table(sgl, 2); 547 sg_init_table(sgl, 2);
545 sg_set_buf(sgl, xmit->buf + xmit->tail, 548 sg_set_buf(sgl, xmit->buf + xmit->tail,
546 UART_XMIT_SIZE - xmit->tail); 549 UART_XMIT_SIZE - xmit->tail);
547 sg_set_buf(sgl + 1, xmit->buf, xmit->head); 550 sg_set_buf(sgl + 1, xmit->buf, xmit->head);
548 } else {
549 sport->dma_tx_nents = 1;
550 sg_init_one(sgl, xmit->buf + xmit->tail, sport->tx_bytes);
551 } 551 }
552 552
553 ret = dma_map_sg(dev, sgl, sport->dma_tx_nents, DMA_TO_DEVICE); 553 ret = dma_map_sg(dev, sgl, sport->dma_tx_nents, DMA_TO_DEVICE);