diff options
Diffstat (limited to 'drivers/dma/s3c24xx-dma.c')
-rw-r--r-- | drivers/dma/s3c24xx-dma.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/drivers/dma/s3c24xx-dma.c b/drivers/dma/s3c24xx-dma.c index 4cb127978636..4eddedb6eb7d 100644 --- a/drivers/dma/s3c24xx-dma.c +++ b/drivers/dma/s3c24xx-dma.c | |||
@@ -628,42 +628,13 @@ retry: | |||
628 | s3cchan->state = S3C24XX_DMA_CHAN_IDLE; | 628 | s3cchan->state = S3C24XX_DMA_CHAN_IDLE; |
629 | } | 629 | } |
630 | 630 | ||
631 | static void s3c24xx_dma_unmap_buffers(struct s3c24xx_txd *txd) | ||
632 | { | ||
633 | struct device *dev = txd->vd.tx.chan->device->dev; | ||
634 | struct s3c24xx_sg *dsg; | ||
635 | |||
636 | if (!(txd->vd.tx.flags & DMA_COMPL_SKIP_SRC_UNMAP)) { | ||
637 | if (txd->vd.tx.flags & DMA_COMPL_SRC_UNMAP_SINGLE) | ||
638 | list_for_each_entry(dsg, &txd->dsg_list, node) | ||
639 | dma_unmap_single(dev, dsg->src_addr, dsg->len, | ||
640 | DMA_TO_DEVICE); | ||
641 | else { | ||
642 | list_for_each_entry(dsg, &txd->dsg_list, node) | ||
643 | dma_unmap_page(dev, dsg->src_addr, dsg->len, | ||
644 | DMA_TO_DEVICE); | ||
645 | } | ||
646 | } | ||
647 | |||
648 | if (!(txd->vd.tx.flags & DMA_COMPL_SKIP_DEST_UNMAP)) { | ||
649 | if (txd->vd.tx.flags & DMA_COMPL_DEST_UNMAP_SINGLE) | ||
650 | list_for_each_entry(dsg, &txd->dsg_list, node) | ||
651 | dma_unmap_single(dev, dsg->dst_addr, dsg->len, | ||
652 | DMA_FROM_DEVICE); | ||
653 | else | ||
654 | list_for_each_entry(dsg, &txd->dsg_list, node) | ||
655 | dma_unmap_page(dev, dsg->dst_addr, dsg->len, | ||
656 | DMA_FROM_DEVICE); | ||
657 | } | ||
658 | } | ||
659 | |||
660 | static void s3c24xx_dma_desc_free(struct virt_dma_desc *vd) | 631 | static void s3c24xx_dma_desc_free(struct virt_dma_desc *vd) |
661 | { | 632 | { |
662 | struct s3c24xx_txd *txd = to_s3c24xx_txd(&vd->tx); | 633 | struct s3c24xx_txd *txd = to_s3c24xx_txd(&vd->tx); |
663 | struct s3c24xx_dma_chan *s3cchan = to_s3c24xx_dma_chan(vd->tx.chan); | 634 | struct s3c24xx_dma_chan *s3cchan = to_s3c24xx_dma_chan(vd->tx.chan); |
664 | 635 | ||
665 | if (!s3cchan->slave) | 636 | if (!s3cchan->slave) |
666 | s3c24xx_dma_unmap_buffers(txd); | 637 | dma_descriptor_unmap(&vd->tx); |
667 | 638 | ||
668 | s3c24xx_dma_free_txd(txd); | 639 | s3c24xx_dma_free_txd(txd); |
669 | } | 640 | } |
@@ -795,7 +766,7 @@ static enum dma_status s3c24xx_dma_tx_status(struct dma_chan *chan, | |||
795 | 766 | ||
796 | spin_lock_irqsave(&s3cchan->vc.lock, flags); | 767 | spin_lock_irqsave(&s3cchan->vc.lock, flags); |
797 | ret = dma_cookie_status(chan, cookie, txstate); | 768 | ret = dma_cookie_status(chan, cookie, txstate); |
798 | if (ret == DMA_SUCCESS) { | 769 | if (ret == DMA_COMPLETE) { |
799 | spin_unlock_irqrestore(&s3cchan->vc.lock, flags); | 770 | spin_unlock_irqrestore(&s3cchan->vc.lock, flags); |
800 | return ret; | 771 | return ret; |
801 | } | 772 | } |