diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2012-03-06 17:35:47 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-03-13 02:07:22 -0400 |
commit | d3ee98cdcd6198ea1cf75c603178acc8a805b69b (patch) | |
tree | 721f252d07d5e0596fa9b58a7c876dfd75823d0a /drivers/dma/ipu/ipu_idmac.c | |
parent | 96a2af41c78b1fbb1f567a3486bdc63f7b31c5fd (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/ipu/ipu_idmac.c')
-rw-r--r-- | drivers/dma/ipu/ipu_idmac.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c index bff9250a59ce..1880274b0850 100644 --- a/drivers/dma/ipu/ipu_idmac.c +++ b/drivers/dma/ipu/ipu_idmac.c | |||
@@ -1504,8 +1504,7 @@ static int idmac_alloc_chan_resources(struct dma_chan *chan) | |||
1504 | BUG_ON(chan->client_count > 1); | 1504 | BUG_ON(chan->client_count > 1); |
1505 | WARN_ON(ichan->status != IPU_CHANNEL_FREE); | 1505 | WARN_ON(ichan->status != IPU_CHANNEL_FREE); |
1506 | 1506 | ||
1507 | chan->cookie = 1; | 1507 | dma_cookie_init(chan); |
1508 | chan->completed_cookie = -ENXIO; | ||
1509 | 1508 | ||
1510 | ret = ipu_irq_map(chan->chan_id); | 1509 | ret = ipu_irq_map(chan->chan_id); |
1511 | if (ret < 0) | 1510 | if (ret < 0) |
@@ -1633,8 +1632,7 @@ static int __init ipu_idmac_init(struct ipu *ipu) | |||
1633 | snprintf(ichan->eof_name, sizeof(ichan->eof_name), "IDMAC EOF %d", i); | 1632 | snprintf(ichan->eof_name, sizeof(ichan->eof_name), "IDMAC EOF %d", i); |
1634 | 1633 | ||
1635 | dma_chan->device = &idmac->dma; | 1634 | dma_chan->device = &idmac->dma; |
1636 | dma_chan->cookie = 1; | 1635 | dma_cookie_init(dma_chan); |
1637 | dma_chan->completed_cookie = -ENXIO; | ||
1638 | dma_chan->chan_id = i; | 1636 | dma_chan->chan_id = i; |
1639 | list_add_tail(&dma_chan->device_node, &dma->channels); | 1637 | list_add_tail(&dma_chan->device_node, &dma->channels); |
1640 | } | 1638 | } |