diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2012-03-06 23:35:47 +0100 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-03-13 07:07:22 +0100 |
commit | d3ee98cdcd6198ea1cf75c603178acc8a805b69b (patch) | |
tree | 721f252d07d5e0596fa9b58a7c876dfd75823d0a /drivers/dma/dmaengine.h | |
parent | dmaengine: consolidate tx_status functions (diff) | |
download | linux-d3ee98cdcd6198ea1cf75c603178acc8a805b69b.tar.xz linux-d3ee98cdcd6198ea1cf75c603178acc8a805b69b.zip |
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/dmaengine.h')
-rw-r--r-- | drivers/dma/dmaengine.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h index 1ca5e0e633f4..17f983a4e9ba 100644 --- a/drivers/dma/dmaengine.h +++ b/drivers/dma/dmaengine.h @@ -9,6 +9,16 @@ #include <linux/dmaengine.h> /** + * dma_cookie_init - initialize the cookies for a DMA channel + * @chan: dma channel to initialize + */ +static inline void dma_cookie_init(struct dma_chan *chan) +{ + chan->cookie = DMA_MIN_COOKIE; + chan->completed_cookie = DMA_MIN_COOKIE; +} + +/** * dma_cookie_assign - assign a DMA engine cookie to the descriptor * @tx: descriptor needing cookie * |