From patchwork Thu Jul 14 21:57:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Jiang X-Patchwork-Id: 9230713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2C38C60572 for ; Thu, 14 Jul 2016 21:57:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C4342819A for ; Thu, 14 Jul 2016 21:57:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10E9728308; Thu, 14 Jul 2016 21:57:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8257D2830A for ; Thu, 14 Jul 2016 21:57:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751911AbcGNV5m (ORCPT ); Thu, 14 Jul 2016 17:57:42 -0400 Received: from mga01.intel.com ([192.55.52.88]:14375 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751540AbcGNV5l (ORCPT ); Thu, 14 Jul 2016 17:57:41 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 14 Jul 2016 14:57:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,364,1464678000"; d="scan'208";a="1007073927" Received: from djiang5-desk3.ch.intel.com ([143.182.137.38]) by fmsmga001.fm.intel.com with ESMTP; 14 Jul 2016 14:57:25 -0700 Subject: [PATCH 03/40] dmaengine: at_xdmac: convert callback to helper function From: Dave Jiang To: vinod.koul@intel.com, lars@metafoo.de Cc: dmaengine@vger.kernel.org, dan.j.williams@intel.com, Ludovic Desroches , laurent.pinchart@ideasonboard.com Date: Thu, 14 Jul 2016 14:57:03 -0700 Message-ID: <146853342353.12248.11183840847910335876.stgit@djiang5-desk3.ch.intel.com> In-Reply-To: <146853287568.12248.6774252283397125297.stgit@djiang5-desk3.ch.intel.com> References: <146853287568.12248.6774252283397125297.stgit@djiang5-desk3.ch.intel.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Convert driver to use the new helper function for callback Signed-off-by: Dave Jiang Cc: Ludovic Desroches Acked-by: Ludovic Desroches --- 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 --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index 75bd662..18e1b92 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 dma_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 dma_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);