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/coh901318.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/coh901318.c')
-rw-r--r-- | drivers/dma/coh901318.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c index d65a718c0f9..521434bc313 100644 --- a/drivers/dma/coh901318.c +++ b/drivers/dma/coh901318.c | |||
@@ -59,7 +59,6 @@ struct coh901318_base { | |||
59 | struct coh901318_chan { | 59 | struct coh901318_chan { |
60 | spinlock_t lock; | 60 | spinlock_t lock; |
61 | int allocated; | 61 | int allocated; |
62 | int completed; | ||
63 | int id; | 62 | int id; |
64 | int stopped; | 63 | int stopped; |
65 | 64 | ||
@@ -705,7 +704,7 @@ static void dma_tasklet(unsigned long data) | |||
705 | callback_param = cohd_fin->desc.callback_param; | 704 | callback_param = cohd_fin->desc.callback_param; |
706 | 705 | ||
707 | /* sign this job as completed on the channel */ | 706 | /* sign this job as completed on the channel */ |
708 | cohc->completed = cohd_fin->desc.cookie; | 707 | cohc->chan.completed_cookie = cohd_fin->desc.cookie; |
709 | 708 | ||
710 | /* release the lli allocation and remove the descriptor */ | 709 | /* release the lli allocation and remove the descriptor */ |
711 | coh901318_lli_free(&cohc->base->pool, &cohd_fin->lli); | 710 | coh901318_lli_free(&cohc->base->pool, &cohd_fin->lli); |
@@ -929,7 +928,7 @@ static int coh901318_alloc_chan_resources(struct dma_chan *chan) | |||
929 | coh901318_config(cohc, NULL); | 928 | coh901318_config(cohc, NULL); |
930 | 929 | ||
931 | cohc->allocated = 1; | 930 | cohc->allocated = 1; |
932 | cohc->completed = chan->cookie = 1; | 931 | chan->completed_cookie = chan->cookie = 1; |
933 | 932 | ||
934 | spin_unlock_irqrestore(&cohc->lock, flags); | 933 | spin_unlock_irqrestore(&cohc->lock, flags); |
935 | 934 | ||
@@ -1169,7 +1168,7 @@ coh901318_tx_status(struct dma_chan *chan, dma_cookie_t cookie, | |||
1169 | dma_cookie_t last_complete; | 1168 | dma_cookie_t last_complete; |
1170 | int ret; | 1169 | int ret; |
1171 | 1170 | ||
1172 | last_complete = cohc->completed; | 1171 | last_complete = chan->completed_cookie; |
1173 | last_used = chan->cookie; | 1172 | last_used = chan->cookie; |
1174 | 1173 | ||
1175 | ret = dma_async_is_complete(cookie, last_complete, last_used); | 1174 | ret = dma_async_is_complete(cookie, last_complete, last_used); |