diff options
author | Magnus Damm <damm@opensource.se> | 2010-03-19 00:47:01 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-03-23 04:19:50 -0400 |
commit | f354a38175f5219146f4675dca770e114cf3c502 (patch) | |
tree | 559e5f3686836e3d068a3ef90ced6902e6682d76 /drivers/serial/sh-sci.c | |
parent | 02ca5083f60521d09f13224596564a405108bc4c (diff) |
serial: sh-sci: Use sg_dma_len() and sg_dma_address()
Convert the dmaengine code in sh-sci.c from
directly accessing the struct scatterlist members
length, dma_length and dma_address to using the
macros sg_dma_len() and sg_dma_address().
Makes the code build for ARM.
Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/serial/sh-sci.c')
-rw-r--r-- | drivers/serial/sh-sci.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 2d9a06db83b5..cd52dd64edf0 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -916,10 +916,10 @@ static void sci_dma_tx_complete(void *arg) | |||
916 | 916 | ||
917 | spin_lock_irqsave(&port->lock, flags); | 917 | spin_lock_irqsave(&port->lock, flags); |
918 | 918 | ||
919 | xmit->tail += s->sg_tx.length; | 919 | xmit->tail += sg_dma_len(&s->sg_tx); |
920 | xmit->tail &= UART_XMIT_SIZE - 1; | 920 | xmit->tail &= UART_XMIT_SIZE - 1; |
921 | 921 | ||
922 | port->icount.tx += s->sg_tx.length; | 922 | port->icount.tx += sg_dma_len(&s->sg_tx); |
923 | 923 | ||
924 | async_tx_ack(s->desc_tx); | 924 | async_tx_ack(s->desc_tx); |
925 | s->cookie_tx = -EINVAL; | 925 | s->cookie_tx = -EINVAL; |
@@ -1134,14 +1134,13 @@ static void work_fn_tx(struct work_struct *work) | |||
1134 | */ | 1134 | */ |
1135 | spin_lock_irq(&port->lock); | 1135 | spin_lock_irq(&port->lock); |
1136 | sg->offset = xmit->tail & (UART_XMIT_SIZE - 1); | 1136 | sg->offset = xmit->tail & (UART_XMIT_SIZE - 1); |
1137 | sg->dma_address = (sg_dma_address(sg) & ~(UART_XMIT_SIZE - 1)) + | 1137 | sg_dma_address(sg) = (sg_dma_address(sg) & ~(UART_XMIT_SIZE - 1)) + |
1138 | sg->offset; | 1138 | sg->offset; |
1139 | sg->length = min((int)CIRC_CNT(xmit->head, xmit->tail, UART_XMIT_SIZE), | 1139 | sg_dma_len(sg) = min((int)CIRC_CNT(xmit->head, xmit->tail, UART_XMIT_SIZE), |
1140 | CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE)); | 1140 | CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE)); |
1141 | sg->dma_length = sg->length; | ||
1142 | spin_unlock_irq(&port->lock); | 1141 | spin_unlock_irq(&port->lock); |
1143 | 1142 | ||
1144 | BUG_ON(!sg->length); | 1143 | BUG_ON(!sg_dma_len(sg)); |
1145 | 1144 | ||
1146 | desc = chan->device->device_prep_slave_sg(chan, | 1145 | desc = chan->device->device_prep_slave_sg(chan, |
1147 | sg, s->sg_len_tx, DMA_TO_DEVICE, | 1146 | sg, s->sg_len_tx, DMA_TO_DEVICE, |
@@ -1342,8 +1341,7 @@ static void sci_request_dma(struct uart_port *port) | |||
1342 | sg_init_table(sg, 1); | 1341 | sg_init_table(sg, 1); |
1343 | sg_set_page(sg, virt_to_page(buf[i]), s->buf_len_rx, | 1342 | sg_set_page(sg, virt_to_page(buf[i]), s->buf_len_rx, |
1344 | (int)buf[i] & ~PAGE_MASK); | 1343 | (int)buf[i] & ~PAGE_MASK); |
1345 | sg->dma_address = dma[i]; | 1344 | sg_dma_address(sg) = dma[i]; |
1346 | sg->dma_length = sg->length; | ||
1347 | } | 1345 | } |
1348 | 1346 | ||
1349 | INIT_WORK(&s->work_rx, work_fn_rx); | 1347 | INIT_WORK(&s->work_rx, work_fn_rx); |