Skip to content

Commit

Permalink
dmaengine: pl330: 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 5c066f7 commit f08462c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/dma/pl330.c
Original file line number Diff line number Diff line change
Expand Up @@ -2039,14 +2039,12 @@ static void pl330_tasklet(unsigned long data)
}

while (!list_empty(&pch->completed_list)) {
dma_async_tx_callback callback;
void *callback_param;
struct dmaengine_desc_callback cb;

desc = list_first_entry(&pch->completed_list,
struct dma_pl330_desc, node);

callback = desc->txd.callback;
callback_param = desc->txd.callback_param;
dmaengine_desc_get_callback(&desc->txd, &cb);

if (pch->cyclic) {
desc->status = PREP;
Expand All @@ -2064,9 +2062,9 @@ static void pl330_tasklet(unsigned long data)

dma_descriptor_unmap(&desc->txd);

if (callback) {
if (dmaengine_desc_callback_valid(&cb)) {
spin_unlock_irqrestore(&pch->lock, flags);
callback(callback_param);
dmaengine_desc_callback_invoke(&cb, NULL);
spin_lock_irqsave(&pch->lock, flags);
}
}
Expand Down

0 comments on commit f08462c

Please sign in to comment.