]> git.karo-electronics.de Git - linux-beck.git/commitdiff
dmaengine: coh901318: convert callback to helper function
authorDave Jiang <dave.jiang@intel.com>
Wed, 20 Jul 2016 20:10:48 +0000 (13:10 -0700)
committerVinod Koul <vinod.koul@intel.com>
Mon, 8 Aug 2016 02:41:38 +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: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/coh901318.c

index e4acd63e42aa37a9048b91a69f8351b444acc498..81d29f0262b808462e00f6fb207c2a4d69624fe8 100644 (file)
@@ -1888,8 +1888,7 @@ static void dma_tasklet(unsigned long data)
        struct coh901318_chan *cohc = (struct coh901318_chan *) data;
        struct coh901318_desc *cohd_fin;
        unsigned long flags;
-       dma_async_tx_callback callback;
-       void *callback_param;
+       struct dmaengine_desc_callback cb;
 
        dev_vdbg(COHC_2_DEV(cohc), "[%s] chan_id %d"
                 " nbr_active_done %ld\n", __func__,
@@ -1904,8 +1903,7 @@ static void dma_tasklet(unsigned long data)
                goto err;
 
        /* locate callback to client */
-       callback = cohd_fin->desc.callback;
-       callback_param = cohd_fin->desc.callback_param;
+       dmaengine_desc_get_callback(&cohd_fin->desc, &cb);
 
        /* sign this job as completed on the channel */
        dma_cookie_complete(&cohd_fin->desc);
@@ -1920,8 +1918,7 @@ static void dma_tasklet(unsigned long data)
        spin_unlock_irqrestore(&cohc->lock, flags);
 
        /* Call the callback when we're done */
-       if (callback)
-               callback(callback_param);
+       dmaengine_desc_callback_invoke(&cb, NULL);
 
        spin_lock_irqsave(&cohc->lock, flags);