dmaengine: consolidate assignment of DMA cookies
Everyone deals with assigning DMA cookies in the same way (it's part of the API so they should be), so lets consolidate the common code into a helper function to avoid this duplication. 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:

gecommit door
Vinod Koul

bovenliggende
d2ebfb335b
commit
884485e1f1
@@ -257,13 +257,7 @@ static dma_cookie_t sirfsoc_dma_tx_submit(struct dma_async_tx_descriptor *txd)
|
||||
/* Move descriptor to queue */
|
||||
list_move_tail(&sdesc->node, &schan->queued);
|
||||
|
||||
/* Update cookie */
|
||||
cookie = schan->chan.cookie + 1;
|
||||
if (cookie <= 0)
|
||||
cookie = 1;
|
||||
|
||||
schan->chan.cookie = cookie;
|
||||
sdesc->desc.cookie = cookie;
|
||||
cookie = dma_cookie_assign(txd);
|
||||
|
||||
spin_unlock_irqrestore(&schan->lock, flags);
|
||||
|
||||
|
Verwijs in nieuw issue
Block a user