Commit 9c1e511c authored by Dave Jiang's avatar Dave Jiang Committed by Vinod Koul

dmaengine: mmp_pdma: convert callback to helper function

This is in preperation of moving to a callback that provides results to the
callback for the transaction. The conversion will maintain current behavior
and the driver must convert to new callback mechanism at a later time in
order to receive results.
Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
Reviewed-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 7a883acd
...@@ -864,19 +864,15 @@ static void dma_do_tasklet(unsigned long data) ...@@ -864,19 +864,15 @@ static void dma_do_tasklet(unsigned long data)
struct mmp_pdma_desc_sw *desc, *_desc; struct mmp_pdma_desc_sw *desc, *_desc;
LIST_HEAD(chain_cleanup); LIST_HEAD(chain_cleanup);
unsigned long flags; unsigned long flags;
struct dmaengine_desc_callback cb;
if (chan->cyclic_first) { if (chan->cyclic_first) {
dma_async_tx_callback cb = NULL;
void *cb_data = NULL;
spin_lock_irqsave(&chan->desc_lock, flags); spin_lock_irqsave(&chan->desc_lock, flags);
desc = chan->cyclic_first; desc = chan->cyclic_first;
cb = desc->async_tx.callback; dmaengine_desc_get_callback(&desc->async_tx, &cb);
cb_data = desc->async_tx.callback_param;
spin_unlock_irqrestore(&chan->desc_lock, flags); spin_unlock_irqrestore(&chan->desc_lock, flags);
if (cb) dmaengine_desc_callback_invoke(&cb, NULL);
cb(cb_data);
return; return;
} }
...@@ -921,8 +917,8 @@ static void dma_do_tasklet(unsigned long data) ...@@ -921,8 +917,8 @@ static void dma_do_tasklet(unsigned long data)
/* Remove from the list of transactions */ /* Remove from the list of transactions */
list_del(&desc->node); list_del(&desc->node);
/* Run the link descriptor callback function */ /* Run the link descriptor callback function */
if (txd->callback) dmaengine_desc_get_callback(txd, &cb);
txd->callback(txd->callback_param); dmaengine_desc_callback_invoke(&cb, NULL);
dma_pool_free(chan->desc_pool, desc, txd->phys); dma_pool_free(chan->desc_pool, desc, txd->phys);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment