dmaengine: consolidate assignment of DMA cookies
[deliverable/linux.git] / drivers / dma / shdma.c
index c2914330b8fc002a60b13bc8773c93d2b853f918..96d0a4fe8dd9b1309b6c2f207dde4896d8534739 100644 (file)
@@ -298,13 +298,7 @@ static dma_cookie_t sh_dmae_tx_submit(struct dma_async_tx_descriptor *tx)
        else
                power_up = false;
 
-       cookie = sh_chan->common.cookie;
-       cookie++;
-       if (cookie < 0)
-               cookie = 1;
-
-       sh_chan->common.cookie = cookie;
-       tx->cookie = cookie;
+       cookie = dma_cookie_assign(tx);
 
        /* Mark all chunks of this descriptor as submitted, move to the queue */
        list_for_each_entry_safe(chunk, c, desc->node.prev, node) {
This page took 0.035695 seconds and 5 git commands to generate.