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>
This commit is contained in:

committed by
Vinod Koul

parent
96a2af41c7
commit
d3ee98cdcd
@@ -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];
|
||||
|
||||
|
Reference in New Issue
Block a user