Skip to content

Commit 1842dc2

Browse files
Cyrille Pitchengregkh
authored andcommitted
tty/serial: at91: fix typo and indentation
Signed-off-by: Cyrille Pitchen <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1cf6e8f commit 1842dc2

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

drivers/tty/serial/atmel_serial.c

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,11 @@ static void atmel_complete_tx_dma(void *arg)
738738
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
739739
uart_write_wakeup(port);
740740

741-
/* Do we really need this? */
741+
/*
742+
* xmit is a circular buffer so, if we have just send data from
743+
* xmit->tail to the end of xmit->buf, now we have to transmit the
744+
* remaining data from the beginning of xmit->buf to xmit->head.
745+
*/
742746
if (!uart_circ_empty(xmit))
743747
tasklet_schedule(&atmel_port->tasklet);
744748

@@ -797,11 +801,11 @@ static void atmel_tx_dma(struct uart_port *port)
797801
BUG_ON(!sg_dma_len(sg));
798802

799803
desc = dmaengine_prep_slave_sg(chan,
800-
sg,
801-
1,
802-
DMA_MEM_TO_DEV,
803-
DMA_PREP_INTERRUPT |
804-
DMA_CTRL_ACK);
804+
sg,
805+
1,
806+
DMA_MEM_TO_DEV,
807+
DMA_PREP_INTERRUPT |
808+
DMA_CTRL_ACK);
805809
if (!desc) {
806810
dev_err(port->dev, "Failed to send via dma!\n");
807811
return;
@@ -1025,13 +1029,13 @@ static int atmel_prepare_rx_dma(struct uart_port *port)
10251029
/* UART circular rx buffer is an aligned page. */
10261030
BUG_ON((int)port->state->xmit.buf & ~PAGE_MASK);
10271031
sg_set_page(&atmel_port->sg_rx,
1028-
virt_to_page(ring->buf),
1029-
ATMEL_SERIAL_RINGSIZE,
1030-
(int)ring->buf & ~PAGE_MASK);
1031-
nent = dma_map_sg(port->dev,
1032-
&atmel_port->sg_rx,
1033-
1,
1034-
DMA_FROM_DEVICE);
1032+
virt_to_page(ring->buf),
1033+
ATMEL_SERIAL_RINGSIZE,
1034+
(int)ring->buf & ~PAGE_MASK);
1035+
nent = dma_map_sg(port->dev,
1036+
&atmel_port->sg_rx,
1037+
1,
1038+
DMA_FROM_DEVICE);
10351039

10361040
if (!nent) {
10371041
dev_dbg(port->dev, "need to release resource of dma\n");
@@ -1060,11 +1064,11 @@ static int atmel_prepare_rx_dma(struct uart_port *port)
10601064
* each one is half ring buffer size
10611065
*/
10621066
desc = dmaengine_prep_dma_cyclic(atmel_port->chan_rx,
1063-
sg_dma_address(&atmel_port->sg_rx),
1064-
sg_dma_len(&atmel_port->sg_rx),
1065-
sg_dma_len(&atmel_port->sg_rx)/2,
1066-
DMA_DEV_TO_MEM,
1067-
DMA_PREP_INTERRUPT);
1067+
sg_dma_address(&atmel_port->sg_rx),
1068+
sg_dma_len(&atmel_port->sg_rx),
1069+
sg_dma_len(&atmel_port->sg_rx)/2,
1070+
DMA_DEV_TO_MEM,
1071+
DMA_PREP_INTERRUPT);
10681072
desc->callback = atmel_complete_rx_dma;
10691073
desc->callback_param = port;
10701074
atmel_port->desc_rx = desc;

0 commit comments

Comments
 (0)