aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/sirf-dma.c
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2012-03-06 17:34:06 -0500
committerVinod Koul <vinod.koul@linux.intel.com>2012-03-13 02:06:06 -0400
commit4d4e58de32a192fea65ab84509d17d199bd291c8 (patch)
treebe35531778c9cc6bee73beb94d07e176a6f3599d /drivers/dma/sirf-dma.c
parent08714f60b0fc6ea3a060b69b32e77139f14e6045 (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/sirf-dma.c')
-rw-r--r--drivers/dma/sirf-dma.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/dma/sirf-dma.c b/drivers/dma/sirf-dma.c
index 2333810d1688..60473f00cf1c 100644
--- a/drivers/dma/sirf-dma.c
+++ b/drivers/dma/sirf-dma.c
@@ -59,7 +59,6 @@ struct sirfsoc_dma_chan {
59 struct list_head queued; 59 struct list_head queued;
60 struct list_head active; 60 struct list_head active;
61 struct list_head completed; 61 struct list_head completed;
62 dma_cookie_t completed_cookie;
63 unsigned long happened_cyclic; 62 unsigned long happened_cyclic;
64 unsigned long completed_cyclic; 63 unsigned long completed_cyclic;
65 64
@@ -208,7 +207,7 @@ static void sirfsoc_dma_process_completed(struct sirfsoc_dma *sdma)
208 /* Free descriptors */ 207 /* Free descriptors */
209 spin_lock_irqsave(&schan->lock, flags); 208 spin_lock_irqsave(&schan->lock, flags);
210 list_splice_tail_init(&list, &schan->free); 209 list_splice_tail_init(&list, &schan->free);
211 schan->completed_cookie = last_cookie; 210 schan->chan.completed_cookie = last_cookie;
212 spin_unlock_irqrestore(&schan->lock, flags); 211 spin_unlock_irqrestore(&schan->lock, flags);
213 } else { 212 } else {
214 /* for cyclic channel, desc is always in active list */ 213 /* for cyclic channel, desc is always in active list */
@@ -419,7 +418,7 @@ sirfsoc_dma_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
419 418
420 spin_lock_irqsave(&schan->lock, flags); 419 spin_lock_irqsave(&schan->lock, flags);
421 last_used = schan->chan.cookie; 420 last_used = schan->chan.cookie;
422 last_complete = schan->completed_cookie; 421 last_complete = schan->chan.completed_cookie;
423 spin_unlock_irqrestore(&schan->lock, flags); 422 spin_unlock_irqrestore(&schan->lock, flags);
424 423
425 dma_set_tx_state(txstate, last_complete, last_used, 0); 424 dma_set_tx_state(txstate, last_complete, last_used, 0);
@@ -636,7 +635,7 @@ static int __devinit sirfsoc_dma_probe(struct platform_device *op)
636 635
637 schan->chan.device = dma; 636 schan->chan.device = dma;
638 schan->chan.cookie = 1; 637 schan->chan.cookie = 1;
639 schan->completed_cookie = schan->chan.cookie; 638 schan->chan.completed_cookie = schan->chan.cookie;
640 639
641 INIT_LIST_HEAD(&schan->free); 640 INIT_LIST_HEAD(&schan->free);
642 INIT_LIST_HEAD(&schan->prepared); 641 INIT_LIST_HEAD(&schan->prepared);