diff options
Diffstat (limited to 'drivers/dma/dw_dmac.c')
-rw-r--r-- | drivers/dma/dw_dmac.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index 12ea60b2a1be..33bde5da850d 100644 --- a/drivers/dma/dw_dmac.c +++ b/drivers/dma/dw_dmac.c | |||
@@ -979,28 +979,17 @@ dwc_tx_status(struct dma_chan *chan, | |||
979 | struct dma_tx_state *txstate) | 979 | struct dma_tx_state *txstate) |
980 | { | 980 | { |
981 | struct dw_dma_chan *dwc = to_dw_dma_chan(chan); | 981 | struct dw_dma_chan *dwc = to_dw_dma_chan(chan); |
982 | dma_cookie_t last_used; | 982 | enum dma_status ret; |
983 | dma_cookie_t last_complete; | ||
984 | int ret; | ||
985 | 983 | ||
986 | last_complete = chan->completed_cookie; | 984 | ret = dma_cookie_status(chan, cookie, txstate); |
987 | last_used = chan->cookie; | ||
988 | |||
989 | ret = dma_async_is_complete(cookie, last_complete, last_used); | ||
990 | if (ret != DMA_SUCCESS) { | 985 | if (ret != DMA_SUCCESS) { |
991 | dwc_scan_descriptors(to_dw_dma(chan->device), dwc); | 986 | dwc_scan_descriptors(to_dw_dma(chan->device), dwc); |
992 | 987 | ||
993 | last_complete = chan->completed_cookie; | 988 | ret = dma_cookie_status(chan, cookie, txstate); |
994 | last_used = chan->cookie; | ||
995 | |||
996 | ret = dma_async_is_complete(cookie, last_complete, last_used); | ||
997 | } | 989 | } |
998 | 990 | ||
999 | if (ret != DMA_SUCCESS) | 991 | if (ret != DMA_SUCCESS) |
1000 | dma_set_tx_state(txstate, last_complete, last_used, | 992 | dma_set_residue(txstate, dwc_first_active(dwc)->len); |
1001 | dwc_first_active(dwc)->len); | ||
1002 | else | ||
1003 | dma_set_tx_state(txstate, last_complete, last_used, 0); | ||
1004 | 993 | ||
1005 | if (dwc->paused) | 994 | if (dwc->paused) |
1006 | return DMA_PAUSED; | 995 | return DMA_PAUSED; |