aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/intel_mid_dma.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/intel_mid_dma.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/intel_mid_dma.c')
-rw-r--r--drivers/dma/intel_mid_dma.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
index c9ab4ac18e41..d599d96a57b6 100644
--- a/drivers/dma/intel_mid_dma.c
+++ b/drivers/dma/intel_mid_dma.c
@@ -867,7 +867,7 @@ static int intel_mid_dma_alloc_chan_resources(struct dma_chan *chan)
867 pm_runtime_put(&mid->pdev->dev); 867 pm_runtime_put(&mid->pdev->dev);
868 return -EIO; 868 return -EIO;
869 } 869 }
870 chan->completed_cookie = chan->cookie = 1; 870 dma_cookie_init(chan);
871 871
872 spin_lock_bh(&midc->lock); 872 spin_lock_bh(&midc->lock);
873 while (midc->descs_allocated < DESCS_PER_CHANNEL) { 873 while (midc->descs_allocated < DESCS_PER_CHANNEL) {
@@ -1100,7 +1100,7 @@ static int mid_setup_dma(struct pci_dev *pdev)
1100 struct intel_mid_dma_chan *midch = &dma->ch[i]; 1100 struct intel_mid_dma_chan *midch = &dma->ch[i];
1101 1101
1102 midch->chan.device = &dma->common; 1102 midch->chan.device = &dma->common;
1103 midch->chan.cookie = 1; 1103 dma_cookie_init(&midch->chan);
1104 midch->ch_id = dma->chan_base + i; 1104 midch->ch_id = dma->chan_base + i;
1105 pr_debug("MDMA:Init CH %d, ID %d\n", i, midch->ch_id); 1105 pr_debug("MDMA:Init CH %d, ID %d\n", i, midch->ch_id);
1106 1106