diff options
Diffstat (limited to 'drivers/dma/amba-pl08x.c')
-rw-r--r-- | drivers/dma/amba-pl08x.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 346327572cfb..810f696eda4e 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c | |||
@@ -964,31 +964,17 @@ static enum dma_status pl08x_dma_tx_status(struct dma_chan *chan, | |||
964 | dma_cookie_t cookie, struct dma_tx_state *txstate) | 964 | dma_cookie_t cookie, struct dma_tx_state *txstate) |
965 | { | 965 | { |
966 | struct pl08x_dma_chan *plchan = to_pl08x_chan(chan); | 966 | struct pl08x_dma_chan *plchan = to_pl08x_chan(chan); |
967 | dma_cookie_t last_used; | ||
968 | dma_cookie_t last_complete; | ||
969 | enum dma_status ret; | 967 | enum dma_status ret; |
970 | u32 bytesleft = 0; | ||
971 | 968 | ||
972 | last_used = plchan->chan.cookie; | 969 | ret = dma_cookie_status(chan, cookie, txstate); |
973 | last_complete = plchan->chan.completed_cookie; | 970 | if (ret == DMA_SUCCESS) |
974 | |||
975 | ret = dma_async_is_complete(cookie, last_complete, last_used); | ||
976 | if (ret == DMA_SUCCESS) { | ||
977 | dma_set_tx_state(txstate, last_complete, last_used, 0); | ||
978 | return ret; | 971 | return ret; |
979 | } | ||
980 | 972 | ||
981 | /* | 973 | /* |
982 | * This cookie not complete yet | 974 | * This cookie not complete yet |
975 | * Get number of bytes left in the active transactions and queue | ||
983 | */ | 976 | */ |
984 | last_used = plchan->chan.cookie; | 977 | dma_set_residue(txstate, pl08x_getbytes_chan(plchan)); |
985 | last_complete = plchan->chan.completed_cookie; | ||
986 | |||
987 | /* Get number of bytes left in the active transactions and queue */ | ||
988 | bytesleft = pl08x_getbytes_chan(plchan); | ||
989 | |||
990 | dma_set_tx_state(txstate, last_complete, last_used, | ||
991 | bytesleft); | ||
992 | 978 | ||
993 | if (plchan->state == PL08X_CHAN_PAUSED) | 979 | if (plchan->state == PL08X_CHAN_PAUSED) |
994 | return DMA_PAUSED; | 980 | return DMA_PAUSED; |