diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2009-06-17 16:08:31 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-06-24 13:34:40 -0400 |
commit | 4ac4aa5cc3b00cc558575065ae71043e92d1a69a (patch) | |
tree | 77000115ec386bca50c5519e3695799ebb6915b8 | |
parent | 2e25406fb878e2313a9d8e302ed7ff3c2831198f (diff) |
DMA: txx9dmac: use dma_unmap_single if DMA_COMPL_{SRC,DEST}_UNMAP_SINGLE set
This patch does not change actual behaviour since dma_unmap_page is just
an alias of dma_unmap_single on MIPS.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | drivers/dma/txx9dmac.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c index 9aa9ea9822c8..88dab52926f4 100644 --- a/drivers/dma/txx9dmac.c +++ b/drivers/dma/txx9dmac.c | |||
@@ -432,23 +432,27 @@ txx9dmac_descriptor_complete(struct txx9dmac_chan *dc, | |||
432 | list_splice_init(&txd->tx_list, &dc->free_list); | 432 | list_splice_init(&txd->tx_list, &dc->free_list); |
433 | list_move(&desc->desc_node, &dc->free_list); | 433 | list_move(&desc->desc_node, &dc->free_list); |
434 | 434 | ||
435 | /* | ||
436 | * We use dma_unmap_page() regardless of how the buffers were | ||
437 | * mapped before they were submitted... | ||
438 | */ | ||
439 | if (!ds) { | 435 | if (!ds) { |
440 | dma_addr_t dmaaddr; | 436 | dma_addr_t dmaaddr; |
441 | if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) { | 437 | if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) { |
442 | dmaaddr = is_dmac64(dc) ? | 438 | dmaaddr = is_dmac64(dc) ? |
443 | desc->hwdesc.DAR : desc->hwdesc32.DAR; | 439 | desc->hwdesc.DAR : desc->hwdesc32.DAR; |
444 | dma_unmap_page(chan2parent(&dc->chan), dmaaddr, | 440 | if (txd->flags & DMA_COMPL_DEST_UNMAP_SINGLE) |
445 | desc->len, DMA_FROM_DEVICE); | 441 | dma_unmap_single(chan2parent(&dc->chan), |
442 | dmaaddr, desc->len, DMA_FROM_DEVICE); | ||
443 | else | ||
444 | dma_unmap_page(chan2parent(&dc->chan), | ||
445 | dmaaddr, desc->len, DMA_FROM_DEVICE); | ||
446 | } | 446 | } |
447 | if (!(txd->flags & DMA_COMPL_SKIP_SRC_UNMAP)) { | 447 | if (!(txd->flags & DMA_COMPL_SKIP_SRC_UNMAP)) { |
448 | dmaaddr = is_dmac64(dc) ? | 448 | dmaaddr = is_dmac64(dc) ? |
449 | desc->hwdesc.SAR : desc->hwdesc32.SAR; | 449 | desc->hwdesc.SAR : desc->hwdesc32.SAR; |
450 | dma_unmap_page(chan2parent(&dc->chan), dmaaddr, | 450 | if (txd->flags & DMA_COMPL_SRC_UNMAP_SINGLE) |
451 | desc->len, DMA_TO_DEVICE); | 451 | dma_unmap_single(chan2parent(&dc->chan), |
452 | dmaaddr, desc->len, DMA_TO_DEVICE); | ||
453 | else | ||
454 | dma_unmap_page(chan2parent(&dc->chan), | ||
455 | dmaaddr, desc->len, DMA_TO_DEVICE); | ||
452 | } | 456 | } |
453 | } | 457 | } |
454 | 458 | ||