diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2012-03-06 17:35:27 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-03-13 02:07:14 -0400 |
commit | 96a2af41c78b1fbb1f567a3486bdc63f7b31c5fd (patch) | |
tree | d977c6b2ff1a23dfd523e70315ebe976a3f3f079 /drivers/dma/pl330.c | |
parent | f7fbce07c6ce26a25b4e0cb5f241c361fde87901 (diff) |
dmaengine: consolidate tx_status functions
Now that we have the completed cookie in the dma_chan structure, we
can consolidate the tx_status functions by providing a function to set
the txstate structure and returning the DMA status. We also provide
a separate helper to set the residue for cookies which are still in
progress.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma/pl330.c')
-rw-r--r-- | drivers/dma/pl330.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index a81d0a5f8191..d43019fc3496 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c | |||
@@ -395,18 +395,7 @@ static enum dma_status | |||
395 | pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie, | 395 | pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie, |
396 | struct dma_tx_state *txstate) | 396 | struct dma_tx_state *txstate) |
397 | { | 397 | { |
398 | struct dma_pl330_chan *pch = to_pchan(chan); | 398 | return dma_cookie_status(chan, cookie, txstate); |
399 | dma_cookie_t last_done, last_used; | ||
400 | int ret; | ||
401 | |||
402 | last_done = chan->completed_cookie; | ||
403 | last_used = chan->cookie; | ||
404 | |||
405 | ret = dma_async_is_complete(cookie, last_done, last_used); | ||
406 | |||
407 | dma_set_tx_state(txstate, last_done, last_used, 0); | ||
408 | |||
409 | return ret; | ||
410 | } | 399 | } |
411 | 400 | ||
412 | static void pl330_issue_pending(struct dma_chan *chan) | 401 | static void pl330_issue_pending(struct dma_chan *chan) |