Skip to content

Commit

Permalink
dmaengine: timb_dma: 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 370c044 commit a06a5bb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/dma/timb_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ static void __td_start_dma(struct timb_dma_chan *td_chan)

static void __td_finish(struct timb_dma_chan *td_chan)
{
dma_async_tx_callback callback;
void *param;
struct dmaengine_desc_callback cb;
struct dma_async_tx_descriptor *txd;
struct timb_dma_desc *td_desc;

Expand All @@ -252,8 +251,7 @@ static void __td_finish(struct timb_dma_chan *td_chan)
dma_cookie_complete(txd);
td_chan->ongoing = false;

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

list_move(&td_desc->desc_node, &td_chan->free_list);

Expand All @@ -262,8 +260,7 @@ static void __td_finish(struct timb_dma_chan *td_chan)
* The API requires that no submissions are done from a
* callback, so we don't need to drop the lock here
*/
if (callback)
callback(param);
dmaengine_desc_callback_invoke(&cb, NULL);
}

static u32 __td_ier_mask(struct timb_dma *td)
Expand Down

0 comments on commit a06a5bb

Please sign in to comment.