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/pch_dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/dma/pch_dma.c') diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c index c30f63ee32c5..c93bb0459972 100644 --- a/drivers/dma/pch_dma.c +++ b/drivers/dma/pch_dma.c @@ -531,7 +531,7 @@ static int pd_alloc_chan_resources(struct dma_chan *chan) spin_lock_irq(&pd_chan->lock); list_splice(&tmp_list, &pd_chan->free_list); pd_chan->descs_allocated = i; - chan->completed_cookie = chan->cookie = 1; + dma_cookie_init(chan); spin_unlock_irq(&pd_chan->lock); pdc_enable_irq(chan, 1); @@ -912,7 +912,7 @@ static int __devinit pch_dma_probe(struct pci_dev *pdev, struct pch_dma_chan *pd_chan = &pd->channels[i]; pd_chan->chan.device = &pd->dma; - pd_chan->chan.cookie = 1; + dma_cookie_init(&pd_chan->chan); pd_chan->membase = ®s->desc[i]; -- cgit v1.2.3