dmaengine: ioatdma: convert callback to helper function
authorDave Jiang <dave.jiang@intel.com>
Wed, 20 Jul 2016 20:11:33 +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/ioat/dma.c

index bd09961443b131a2e81d5a27d9dba160d4b52567..6499de4b8e799ca0d43c0657fed0f2c5c22021d3 100644 (file)
@@ -570,10 +570,8 @@ static void __cleanup(struct ioatdma_chan *ioat_chan, dma_addr_t phys_complete)
                if (tx->cookie) {
                        dma_cookie_complete(tx);
                        dma_descriptor_unmap(tx);
-                       if (tx->callback) {
-                               tx->callback(tx->callback_param);
-                               tx->callback = NULL;
-                       }
+                       dmaengine_desc_get_callback_invoke(tx, NULL);
+                       tx->callback = NULL;
                }
 
                if (tx->phys == phys_complete)
@@ -707,10 +705,8 @@ static void ioat_eh(struct ioatdma_chan *ioat_chan)
                if (tx->cookie) {
                        dma_cookie_complete(tx);
                        dma_descriptor_unmap(tx);
-                       if (tx->callback) {
-                               tx->callback(tx->callback_param);
-                               tx->callback = NULL;
-                       }
+                       dmaengine_desc_get_callback_invoke(tx, NULL);
+                       tx->callback = NULL;
                }
        }