diff mbox

[v2,03/41] dmaengine: at_xdmac: convert callback to helper function

Message ID 146861388281.154751.1679165841774749076.stgit@djiang5-desk3.ch.intel.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Dave Jiang July 15, 2016, 8:18 p.m. UTC
Convert driver to use the new helper function for callback

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Cc: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 drivers/dma/at_xdmac.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
index 75bd662..4ff9f17 100644
--- a/drivers/dma/at_xdmac.c
+++ b/drivers/dma/at_xdmac.c
@@ -1568,12 +1568,15 @@  static void at_xdmac_handle_cyclic(struct at_xdmac_chan *atchan)
 {
 	struct at_xdmac_desc		*desc;
 	struct dma_async_tx_descriptor	*txd;
+	struct dmaengine_desc_callback	cb;
 
 	desc = list_first_entry(&atchan->xfers_list, struct at_xdmac_desc, xfer_node);
 	txd = &desc->tx_dma_desc;
 
-	if (txd->callback && (txd->flags & DMA_PREP_INTERRUPT))
-		txd->callback(txd->callback_param);
+	if (txd->flags & DMA_PREP_INTERRUPT) {
+		dmaengine_desc_get_callback(txd, &cb);
+		dmaengine_desc_callback_invoke(&cb, NULL);
+	}
 }
 
 static void at_xdmac_tasklet(unsigned long data)
@@ -1615,9 +1618,13 @@  static void at_xdmac_tasklet(unsigned long data)
 		spin_unlock_bh(&atchan->lock);
 
 		if (!at_xdmac_chan_is_cyclic(atchan)) {
+			struct dmaengine_desc_callback	cb;
+
 			dma_cookie_complete(txd);
-			if (txd->callback && (txd->flags & DMA_PREP_INTERRUPT))
-				txd->callback(txd->callback_param);
+			if (txd->flags & DMA_PREP_INTERRUPT) {
+				dmaengine_desc_get_callback(txd, &cb);
+				dmaengine_desc_callback_invoke(&cb, NULL);
+			}
 		}
 
 		dma_run_dependencies(txd);