diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2012-03-06 17:34:06 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-03-13 02:06:06 -0400 |
commit | 4d4e58de32a192fea65ab84509d17d199bd291c8 (patch) | |
tree | be35531778c9cc6bee73beb94d07e176a6f3599d /drivers/dma/iop-adma.c | |
parent | 08714f60b0fc6ea3a060b69b32e77139f14e6045 (diff) |
dmaengine: move last completed cookie into generic dma_chan structure
Every DMA engine implementation declares a last completed dma cookie
in their private dma channel structures. This is pointless, and
forces driver specific code. Move this out into the common dma_chan
structure.
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/iop-adma.c')
-rw-r--r-- | drivers/dma/iop-adma.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c index 04be90b645b8..d8027c2b42c0 100644 --- a/drivers/dma/iop-adma.c +++ b/drivers/dma/iop-adma.c | |||
@@ -317,7 +317,7 @@ static void __iop_adma_slot_cleanup(struct iop_adma_chan *iop_chan) | |||
317 | } | 317 | } |
318 | 318 | ||
319 | if (cookie > 0) { | 319 | if (cookie > 0) { |
320 | iop_chan->completed_cookie = cookie; | 320 | iop_chan->common.completed_cookie = cookie; |
321 | pr_debug("\tcompleted cookie %d\n", cookie); | 321 | pr_debug("\tcompleted cookie %d\n", cookie); |
322 | } | 322 | } |
323 | } | 323 | } |
@@ -909,7 +909,7 @@ static enum dma_status iop_adma_status(struct dma_chan *chan, | |||
909 | enum dma_status ret; | 909 | enum dma_status ret; |
910 | 910 | ||
911 | last_used = chan->cookie; | 911 | last_used = chan->cookie; |
912 | last_complete = iop_chan->completed_cookie; | 912 | last_complete = chan->completed_cookie; |
913 | dma_set_tx_state(txstate, last_complete, last_used, 0); | 913 | dma_set_tx_state(txstate, last_complete, last_used, 0); |
914 | ret = dma_async_is_complete(cookie, last_complete, last_used); | 914 | ret = dma_async_is_complete(cookie, last_complete, last_used); |
915 | if (ret == DMA_SUCCESS) | 915 | if (ret == DMA_SUCCESS) |
@@ -918,7 +918,7 @@ static enum dma_status iop_adma_status(struct dma_chan *chan, | |||
918 | iop_adma_slot_cleanup(iop_chan); | 918 | iop_adma_slot_cleanup(iop_chan); |
919 | 919 | ||
920 | last_used = chan->cookie; | 920 | last_used = chan->cookie; |
921 | last_complete = iop_chan->completed_cookie; | 921 | last_complete = chan->completed_cookie; |
922 | dma_set_tx_state(txstate, last_complete, last_used, 0); | 922 | dma_set_tx_state(txstate, last_complete, last_used, 0); |
923 | 923 | ||
924 | return dma_async_is_complete(cookie, last_complete, last_used); | 924 | return dma_async_is_complete(cookie, last_complete, last_used); |
@@ -1650,7 +1650,7 @@ static void iop_chan_start_null_memcpy(struct iop_adma_chan *iop_chan) | |||
1650 | /* initialize the completed cookie to be less than | 1650 | /* initialize the completed cookie to be less than |
1651 | * the most recently used cookie | 1651 | * the most recently used cookie |
1652 | */ | 1652 | */ |
1653 | iop_chan->completed_cookie = cookie - 1; | 1653 | iop_chan->common.completed_cookie = cookie - 1; |
1654 | iop_chan->common.cookie = sw_desc->async_tx.cookie = cookie; | 1654 | iop_chan->common.cookie = sw_desc->async_tx.cookie = cookie; |
1655 | 1655 | ||
1656 | /* channel should not be busy */ | 1656 | /* channel should not be busy */ |
@@ -1707,7 +1707,7 @@ static void iop_chan_start_null_xor(struct iop_adma_chan *iop_chan) | |||
1707 | /* initialize the completed cookie to be less than | 1707 | /* initialize the completed cookie to be less than |
1708 | * the most recently used cookie | 1708 | * the most recently used cookie |
1709 | */ | 1709 | */ |
1710 | iop_chan->completed_cookie = cookie - 1; | 1710 | iop_chan->common.completed_cookie = cookie - 1; |
1711 | iop_chan->common.cookie = sw_desc->async_tx.cookie = cookie; | 1711 | iop_chan->common.cookie = sw_desc->async_tx.cookie = cookie; |
1712 | 1712 | ||
1713 | /* channel should not be busy */ | 1713 | /* channel should not be busy */ |