From patchwork Thu Jul 14 21:56:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Jiang X-Patchwork-Id: 9230707 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 C9B6760572 for ; Thu, 14 Jul 2016 21:57:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B977E2819A for ; Thu, 14 Jul 2016 21:57:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE37028308; Thu, 14 Jul 2016 21:57:21 +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 1D0F52819A for ; Thu, 14 Jul 2016 21:57:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751540AbcGNV5U (ORCPT ); Thu, 14 Jul 2016 17:57:20 -0400 Received: from mga11.intel.com ([192.55.52.93]:14778 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750699AbcGNV5U (ORCPT ); Thu, 14 Jul 2016 17:57:20 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 14 Jul 2016 14:57:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,364,1464678000"; d="scan'208";a="1017120875" Received: from djiang5-desk3.ch.intel.com ([143.182.137.38]) by orsmga002.jf.intel.com with ESMTP; 14 Jul 2016 14:57:18 -0700 Subject: [PATCH 02/40] dmaengine: at_hdmac: 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, Nicolas Ferre , laurent.pinchart@ideasonboard.com Date: Thu, 14 Jul 2016 14:56:57 -0700 Message-ID: <146853341763.12248.12246775024037350361.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: Nicolas Ferre Tested-by: Ludovic Desroches --- drivers/dma/at_hdmac.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 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_hdmac.c b/drivers/dma/at_hdmac.c index 53d22eb..e1622d0 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -473,15 +473,14 @@ atc_chain_complete(struct at_dma_chan *atchan, struct at_desc *desc) /* for cyclic transfers, * no need to replay callback function while stopping */ if (!atc_chan_is_cyclic(atchan)) { - dma_async_tx_callback callback = txd->callback; - void *param = txd->callback_param; + struct dma_desc_callback cb; /* * The API requires that no submissions are done from a * callback, so we don't need to drop the lock here */ - if (callback) - callback(param); + dmaengine_desc_get_callback(txd, &cb); + dmaengine_desc_callback_invoke(&cb, NULL); } dma_run_dependencies(txd); @@ -598,15 +597,14 @@ static void atc_handle_cyclic(struct at_dma_chan *atchan) { struct at_desc *first = atc_first_active(atchan); struct dma_async_tx_descriptor *txd = &first->txd; - dma_async_tx_callback callback = txd->callback; - void *param = txd->callback_param; + struct dma_desc_callback cb; dev_vdbg(chan2dev(&atchan->chan_common), "new cyclic period llp 0x%08x\n", channel_readl(atchan, DSCR)); - if (callback) - callback(param); + dmaengine_desc_get_callback(txd, &cb); + dmaengine_desc_callback_invoke(&cb, NULL); } /*-- IRQ & Tasklet ---------------------------------------------------*/