diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2012-03-06 17:35:47 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-03-13 02:07:22 -0400 |
commit | d3ee98cdcd6198ea1cf75c603178acc8a805b69b (patch) | |
tree | 721f252d07d5e0596fa9b58a7c876dfd75823d0a /drivers/dma/timb_dma.c | |
parent | 96a2af41c78b1fbb1f567a3486bdc63f7b31c5fd (diff) |
dmaengine: consolidate initialization of cookies
Provide a common function to initialize a channels cookie values.
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/timb_dma.c')
-rw-r--r-- | drivers/dma/timb_dma.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c index 6383abbecce6..7805996661b8 100644 --- a/drivers/dma/timb_dma.c +++ b/drivers/dma/timb_dma.c | |||
@@ -477,8 +477,7 @@ static int td_alloc_chan_resources(struct dma_chan *chan) | |||
477 | } | 477 | } |
478 | 478 | ||
479 | spin_lock_bh(&td_chan->lock); | 479 | spin_lock_bh(&td_chan->lock); |
480 | chan->completed_cookie = 1; | 480 | dma_cookie_init(chan); |
481 | chan->cookie = 1; | ||
482 | spin_unlock_bh(&td_chan->lock); | 481 | spin_unlock_bh(&td_chan->lock); |
483 | 482 | ||
484 | return 0; | 483 | return 0; |
@@ -755,7 +754,7 @@ static int __devinit td_probe(struct platform_device *pdev) | |||
755 | } | 754 | } |
756 | 755 | ||
757 | td_chan->chan.device = &td->dma; | 756 | td_chan->chan.device = &td->dma; |
758 | td_chan->chan.cookie = 1; | 757 | dma_cookie_init(&td_chan->chan); |
759 | spin_lock_init(&td_chan->lock); | 758 | spin_lock_init(&td_chan->lock); |
760 | INIT_LIST_HEAD(&td_chan->active_list); | 759 | INIT_LIST_HEAD(&td_chan->active_list); |
761 | INIT_LIST_HEAD(&td_chan->queue); | 760 | INIT_LIST_HEAD(&td_chan->queue); |