aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/dw_dmac.c
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2012-03-06 17:35:47 -0500
committerVinod Koul <vinod.koul@linux.intel.com>2012-03-13 02:07:22 -0400
commitd3ee98cdcd6198ea1cf75c603178acc8a805b69b (patch)
tree721f252d07d5e0596fa9b58a7c876dfd75823d0a /drivers/dma/dw_dmac.c
parent96a2af41c78b1fbb1f567a3486bdc63f7b31c5fd (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/dw_dmac.c')
-rw-r--r--drivers/dma/dw_dmac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index 33bde5da850d..cb173bbdcfdf 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -1021,7 +1021,7 @@ static int dwc_alloc_chan_resources(struct dma_chan *chan)
1021 return -EIO; 1021 return -EIO;
1022 } 1022 }
1023 1023
1024 chan->completed_cookie = chan->cookie = 1; 1024 dma_cookie_init(chan);
1025 1025
1026 /* 1026 /*
1027 * NOTE: some controllers may have additional features that we 1027 * NOTE: some controllers may have additional features that we
@@ -1449,7 +1449,7 @@ static int __init dw_probe(struct platform_device *pdev)
1449 struct dw_dma_chan *dwc = &dw->chan[i]; 1449 struct dw_dma_chan *dwc = &dw->chan[i];
1450 1450
1451 dwc->chan.device = &dw->dma; 1451 dwc->chan.device = &dw->dma;
1452 dwc->chan.cookie = dwc->chan.completed_cookie = 1; 1452 dma_cookie_init(&dwc->chan);
1453 if (pdata->chan_allocation_order == CHAN_ALLOCATION_ASCENDING) 1453 if (pdata->chan_allocation_order == CHAN_ALLOCATION_ASCENDING)
1454 list_add_tail(&dwc->chan.device_node, 1454 list_add_tail(&dwc->chan.device_node,
1455 &dw->dma.channels); 1455 &dw->dma.channels);