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/mv_xor.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/mv_xor.c')
-rw-r--r-- | drivers/dma/mv_xor.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index d9810ce3794c..486353e60a0a 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c | |||
@@ -810,26 +810,16 @@ static enum dma_status mv_xor_status(struct dma_chan *chan, | |||
810 | struct dma_tx_state *txstate) | 810 | struct dma_tx_state *txstate) |
811 | { | 811 | { |
812 | struct mv_xor_chan *mv_chan = to_mv_xor_chan(chan); | 812 | struct mv_xor_chan *mv_chan = to_mv_xor_chan(chan); |
813 | dma_cookie_t last_used; | ||
814 | dma_cookie_t last_complete; | ||
815 | enum dma_status ret; | 813 | enum dma_status ret; |
816 | 814 | ||
817 | last_used = chan->cookie; | 815 | ret = dma_cookie_status(chan, cookie, txstate); |
818 | last_complete = chan->completed_cookie; | ||
819 | dma_set_tx_state(txstate, last_complete, last_used, 0); | ||
820 | |||
821 | ret = dma_async_is_complete(cookie, last_complete, last_used); | ||
822 | if (ret == DMA_SUCCESS) { | 816 | if (ret == DMA_SUCCESS) { |
823 | mv_xor_clean_completed_slots(mv_chan); | 817 | mv_xor_clean_completed_slots(mv_chan); |
824 | return ret; | 818 | return ret; |
825 | } | 819 | } |
826 | mv_xor_slot_cleanup(mv_chan); | 820 | mv_xor_slot_cleanup(mv_chan); |
827 | 821 | ||
828 | last_used = chan->cookie; | 822 | return dma_cookie_status(chan, cookie, txstate); |
829 | last_complete = chan->completed_cookie; | ||
830 | |||
831 | dma_set_tx_state(txstate, last_complete, last_used, 0); | ||
832 | return dma_async_is_complete(cookie, last_complete, last_used); | ||
833 | } | 823 | } |
834 | 824 | ||
835 | static void mv_dump_xor_regs(struct mv_xor_chan *chan) | 825 | static void mv_dump_xor_regs(struct mv_xor_chan *chan) |