dmaengine: pch_dma: convert callback to helper function
authorDave Jiang <dave.jiang@intel.com>
Wed, 20 Jul 2016 20:12:29 +0000 (13:12 -0700)
committerVinod Koul <vinod.koul@intel.com>
Mon, 8 Aug 2016 02:41:40 +0000 (08:11 +0530)
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 <dave.jiang@intel.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/pch_dma.c

index 113605f6fe20876495f0629d4cb16905471eb111..df95727dc2fbaeb3c16f2511e60327360c3995fc 100644 (file)
@@ -357,14 +357,13 @@ static void pdc_chain_complete(struct pch_dma_chan *pd_chan,
                               struct pch_dma_desc *desc)
 {
        struct dma_async_tx_descriptor *txd = &desc->txd;
-       dma_async_tx_callback callback = txd->callback;
-       void *param = txd->callback_param;
+       struct dmaengine_desc_callback cb;
 
+       dmaengine_desc_get_callback(txd, &cb);
        list_splice_init(&desc->tx_list, &pd_chan->free_list);
        list_move(&desc->desc_node, &pd_chan->free_list);
 
-       if (callback)
-               callback(param);
+       dmaengine_desc_callback_invoke(&cb, NULL);
 }
 
 static void pdc_complete_all(struct pch_dma_chan *pd_chan)