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>
This commit is contained in:

committed by
Vinod Koul

parent
96a2af41c7
commit
d3ee98cdcd
@@ -8,6 +8,16 @@
|
||||
#include <linux/bug.h>
|
||||
#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
|
||||
|
Reference in New Issue
Block a user