Skip to content

Commit

Permalink
dmaengine: mmp_pdma: convert callback to helper function
Browse files Browse the repository at this point in the history
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: Dave Jiang <[email protected]>
Reviewed-by: Lars-Peter Clausen <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
davejiang authored and Vinod Koul committed Aug 8, 2016
1 parent 7a883ac commit 9c1e511
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions drivers/dma/mmp_pdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,19 +864,15 @@ static void dma_do_tasklet(unsigned long data)
struct mmp_pdma_desc_sw *desc, *_desc;
LIST_HEAD(chain_cleanup);
unsigned long flags;
struct dmaengine_desc_callback cb;

if (chan->cyclic_first) {
dma_async_tx_callback cb = NULL;
void *cb_data = NULL;

spin_lock_irqsave(&chan->desc_lock, flags);
desc = chan->cyclic_first;
cb = desc->async_tx.callback;
cb_data = desc->async_tx.callback_param;
dmaengine_desc_get_callback(&desc->async_tx, &cb);
spin_unlock_irqrestore(&chan->desc_lock, flags);

if (cb)
cb(cb_data);
dmaengine_desc_callback_invoke(&cb, NULL);

return;
}
Expand Down Expand Up @@ -921,8 +917,8 @@ static void dma_do_tasklet(unsigned long data)
/* Remove from the list of transactions */
list_del(&desc->node);
/* Run the link descriptor callback function */
if (txd->callback)
txd->callback(txd->callback_param);
dmaengine_desc_get_callback(txd, &cb);
dmaengine_desc_callback_invoke(&cb, NULL);

dma_pool_free(chan->desc_pool, desc, txd->phys);
}
Expand Down

0 comments on commit 9c1e511

Please sign in to comment.