diff options
Diffstat (limited to 'drivers/dma/at_hdmac.c')
-rw-r--r-- | drivers/dma/at_hdmac.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index b2826304da24..8a3297418cf0 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c | |||
@@ -996,26 +996,20 @@ atc_tx_status(struct dma_chan *chan, | |||
996 | 996 | ||
997 | spin_lock_irqsave(&atchan->lock, flags); | 997 | spin_lock_irqsave(&atchan->lock, flags); |
998 | 998 | ||
999 | last_complete = chan->completed_cookie; | 999 | ret = dma_cookie_status(chan, cookie, txstate); |
1000 | last_used = chan->cookie; | ||
1001 | |||
1002 | ret = dma_async_is_complete(cookie, last_complete, last_used); | ||
1003 | if (ret != DMA_SUCCESS) { | 1000 | if (ret != DMA_SUCCESS) { |
1004 | atc_cleanup_descriptors(atchan); | 1001 | atc_cleanup_descriptors(atchan); |
1005 | 1002 | ||
1006 | last_complete = chan->completed_cookie; | 1003 | ret = dma_cookie_status(chan, cookie, txstate); |
1007 | last_used = chan->cookie; | ||
1008 | |||
1009 | ret = dma_async_is_complete(cookie, last_complete, last_used); | ||
1010 | } | 1004 | } |
1011 | 1005 | ||
1006 | last_complete = chan->completed_cookie; | ||
1007 | last_used = chan->cookie; | ||
1008 | |||
1012 | spin_unlock_irqrestore(&atchan->lock, flags); | 1009 | spin_unlock_irqrestore(&atchan->lock, flags); |
1013 | 1010 | ||
1014 | if (ret != DMA_SUCCESS) | 1011 | if (ret != DMA_SUCCESS) |
1015 | dma_set_tx_state(txstate, last_complete, last_used, | 1012 | dma_set_residue(txstate, atc_first_active(atchan)->len); |
1016 | atc_first_active(atchan)->len); | ||
1017 | else | ||
1018 | dma_set_tx_state(txstate, last_complete, last_used, 0); | ||
1019 | 1013 | ||
1020 | if (atc_chan_is_paused(atchan)) | 1014 | if (atc_chan_is_paused(atchan)) |
1021 | ret = DMA_PAUSED; | 1015 | ret = DMA_PAUSED; |