dmaengine: imx-sdma: convert callback to helper function
authorDave Jiang <dave.jiang@intel.com>
Wed, 20 Jul 2016 20:11:28 +0000 (13:11 -0700)
committerVinod Koul <vinod.koul@intel.com>
Mon, 8 Aug 2016 02:41:39 +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/imx-sdma.c

index 03ec76fc22ff191423bc354e5b5005a621d83412..624facb6c8f41f0dd6c4344503efc3f4a2adf775 100644 (file)
@@ -650,8 +650,7 @@ static void sdma_event_disable(struct sdma_channel *sdmac, unsigned int event)
 
 static void sdma_handle_channel_loop(struct sdma_channel *sdmac)
 {
-       if (sdmac->desc.callback)
-               sdmac->desc.callback(sdmac->desc.callback_param);
+       dmaengine_desc_get_callback_invoke(&sdmac->desc, NULL);
 }
 
 static void sdma_update_channel_loop(struct sdma_channel *sdmac)
@@ -701,8 +700,8 @@ static void mxc_sdma_handle_channel_normal(struct sdma_channel *sdmac)
                sdmac->status = DMA_COMPLETE;
 
        dma_cookie_complete(&sdmac->desc);
-       if (sdmac->desc.callback)
-               sdmac->desc.callback(sdmac->desc.callback_param);
+
+       dmaengine_desc_get_callback_invoke(&sdmac->desc, NULL);
 }
 
 static void sdma_tasklet(unsigned long data)