From d3ee98cdcd6198ea1cf75c603178acc8a805b69b Mon Sep 17 00:00:00 2001 From: Russell King - ARM Linux Date: Tue, 6 Mar 2012 22:35:47 +0000 Subject: dmaengine: consolidate initialization of cookies Provide a common function to initialize a channels cookie values. Signed-off-by: Russell King Tested-by: Linus Walleij Reviewed-by: Linus Walleij Acked-by: Jassi Brar [imx-sdma.c & mxs-dma.c] Tested-by: Shawn Guo Signed-off-by: Vinod Koul --- drivers/dma/timb_dma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/dma/timb_dma.c') 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) } spin_lock_bh(&td_chan->lock); - chan->completed_cookie = 1; - chan->cookie = 1; + dma_cookie_init(chan); spin_unlock_bh(&td_chan->lock); return 0; @@ -755,7 +754,7 @@ static int __devinit td_probe(struct platform_device *pdev) } td_chan->chan.device = &td->dma; - td_chan->chan.cookie = 1; + dma_cookie_init(&td_chan->chan); spin_lock_init(&td_chan->lock); INIT_LIST_HEAD(&td_chan->active_list); INIT_LIST_HEAD(&td_chan->queue); -- cgit v1.2.3