]> git.karo-electronics.de Git - linux-beck.git/commitdiff
dmaengine: qcom_hidma: convert callback to helper function
authorDave Jiang <dave.jiang@intel.com>
Wed, 20 Jul 2016 20:12:47 +0000 (13:12 -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>
Acked-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/qcom/hidma.c

index b2374cd91e457f38b946548cd3bcda7aed47e82e..1197fbf8f30e0941eaea4159e00379ebf113cdea 100644 (file)
@@ -132,8 +132,8 @@ static void hidma_process_completed(struct hidma_chan *mchan)
                spin_unlock_irqrestore(&mchan->lock, irqflags);
 
                llstat = hidma_ll_status(mdma->lldev, mdesc->tre_ch);
-               if (desc->callback && (llstat == DMA_COMPLETE))
-                       desc->callback(desc->callback_param);
+               if (llstat == DMA_COMPLETE)
+                       dmaengine_desc_get_callback_invoke(desc, NULL);
 
                last_cookie = desc->cookie;
                dma_run_dependencies(desc);
@@ -413,14 +413,9 @@ static int hidma_terminate_channel(struct dma_chan *chan)
        /* return all user requests */
        list_for_each_entry_safe(mdesc, tmp, &list, node) {
                struct dma_async_tx_descriptor *txd = &mdesc->desc;
-               dma_async_tx_callback callback = mdesc->desc.callback;
-               void *param = mdesc->desc.callback_param;
 
                dma_descriptor_unmap(txd);
-
-               if (callback)
-                       callback(param);
-
+               dmaengine_desc_get_callback_invoke(txd, NULL);
                dma_run_dependencies(txd);
 
                /* move myself to free_list */