dmaengine: tegra20-apb-dma: convert callback to helper function
authorDave Jiang <dave.jiang@intel.com>
Wed, 20 Jul 2016 20:13:16 +0000 (13:13 -0700)
committerVinod Koul <vinod.koul@intel.com>
Mon, 8 Aug 2016 02:41:41 +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>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/tegra20-apb-dma.c

index 6ab9eb98588a88514f64f4b1221d87da3ecc4721..3722b9d8d9fe203124ead98c5fc823da84d4bf84 100644 (file)
@@ -655,8 +655,7 @@ static void handle_cont_sngl_cycle_dma_done(struct tegra_dma_channel *tdc,
 static void tegra_dma_tasklet(unsigned long data)
 {
        struct tegra_dma_channel *tdc = (struct tegra_dma_channel *)data;
-       dma_async_tx_callback callback = NULL;
-       void *callback_param = NULL;
+       struct dmaengine_desc_callback cb;
        struct tegra_dma_desc *dma_desc;
        unsigned long flags;
        int cb_count;
@@ -666,13 +665,12 @@ static void tegra_dma_tasklet(unsigned long data)
                dma_desc  = list_first_entry(&tdc->cb_desc,
                                        typeof(*dma_desc), cb_node);
                list_del(&dma_desc->cb_node);
-               callback = dma_desc->txd.callback;
-               callback_param = dma_desc->txd.callback_param;
+               dmaengine_desc_get_callback(&dma_desc->txd, &cb);
                cb_count = dma_desc->cb_count;
                dma_desc->cb_count = 0;
                spin_unlock_irqrestore(&tdc->lock, flags);
-               while (cb_count-- && callback)
-                       callback(callback_param);
+               while (cb_count--)
+                       dmaengine_desc_callback_invoke(&cb, NULL);
                spin_lock_irqsave(&tdc->lock, flags);
        }
        spin_unlock_irqrestore(&tdc->lock, flags);