summaryrefslogtreecommitdiff
path: root/drivers/dma/at_hdmac.c
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2012-03-06 22:35:47 +0000
committerSimone Willett <swillett@nvidia.com>2012-04-03 09:36:16 -0700
commitff27e02b2ca48beb0330473427fa8e0be64c15ab (patch)
tree368456e1e5e5001ea132e57a748defbfe9309775 /drivers/dma/at_hdmac.c
parentb1ca7f8af4b3c86635fc523283c2bed9175aea14 (diff)
dmaengine: consolidate initialization of cookies
Provide a common function to initialize a channels cookie values. Change-Id: Idc822d69971d7a6d26ffea8809df4825b87020e5 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> (cherry picked from mainline commit d3ee98cdcd6198ea1cf75c603178acc8a805b69b) Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Change-Id: Id7d52f05b78d15b0c61cb04122b19810e78b9269 Reviewed-on: http://git-master/r/93783
Diffstat (limited to 'drivers/dma/at_hdmac.c')
-rw-r--r--drivers/dma/at_hdmac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index ddeeadded1af..2def41f09f65 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1093,7 +1093,7 @@ static int atc_alloc_chan_resources(struct dma_chan *chan)
spin_lock_bh(&atchan->lock);
atchan->descs_allocated = i;
list_splice(&tmp_list, &atchan->free_list);
- atchan->completed_cookie = chan->cookie = 1;
+ dma_cookie_init(chan);
spin_unlock_bh(&atchan->lock);
/* channel parameters */
@@ -1239,7 +1239,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
atchan->chan_common.device = &atdma->dma_common;
atchan->chan_common.chan_id = i;
- 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);