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
@@ -1103,7 +1103,7 @@ static int atc_alloc_chan_resources(struct dma_chan *chan)
|
||||
spin_lock_irqsave(&atchan->lock, flags);
|
||||
atchan->descs_allocated = i;
|
||||
list_splice(&tmp_list, &atchan->free_list);
|
||||
chan->completed_cookie = chan->cookie = 1;
|
||||
dma_cookie_init(chan);
|
||||
spin_unlock_irqrestore(&atchan->lock, flags);
|
||||
|
||||
/* channel parameters */
|
||||
@@ -1303,7 +1303,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
|
||||
struct at_dma_chan *atchan = &atdma->chan[i];
|
||||
|
||||
atchan->chan_common.device = &atdma->dma_common;
|
||||
atchan->chan_common.cookie = atchan->chan_common.completed_cookie = 1;
|
||||
dma_cookie_init(&atchan->chan_common);
|
||||
list_add_tail(&atchan->chan_common.device_node,
|
||||
&atdma->dma_common.channels);
|
||||
|
||||
|
Reference in New Issue
Block a user