From patchwork Wed Aug 1 09:36:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ludovic BARRE X-Patchwork-Id: 10551957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C72C813BB for ; Wed, 1 Aug 2018 09:38:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5E422A403 for ; Wed, 1 Aug 2018 09:38:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA07C2A4D2; Wed, 1 Aug 2018 09:38:37 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4DD672A403 for ; Wed, 1 Aug 2018 09:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rO453sIxvyeMN2N5C8c6FDR+DBFh6ZefnoFgC1r8yR8=; b=iimcWInjVzfj8j DwrF4Bj49GIgdyf/QSMvNOdYMtRGjT+VJCvsNvvuY+TTzrM0QgnI7BoRTZHI+l8dzVHZAFDriOOcK LwQzvgQA+C5Uzb38njVODb4RuAhLw8Eo3ztV67XIuqGKqktwQeN3BULnem0G2VeDurwNO9ygVJgV2 drC7y1jbT9knBIrrGFSrFM7odjI3LqM0ZFWQlDbsO1PLPTsH8sH1QQmPfa2R3T4+JWoh6N9rQ/tEk NJ7LShN/1XPAeru+Fh+tRSm8N3zss7Lmln+eJCLjXLEKLSTHML89mVUfWORbg0GNP65DSOemU6l9C hMgPFo9q5uWoN18zL/dg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fknaQ-0002iK-Uf; Wed, 01 Aug 2018 09:38:30 +0000 Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fknZb-0001dj-PN for linux-arm-kernel@lists.infradead.org; Wed, 01 Aug 2018 09:37:43 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w719TSGg009408; Wed, 1 Aug 2018 11:37:30 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2kjnaddbd7-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 01 Aug 2018 11:37:30 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 67D3E34; Wed, 1 Aug 2018 09:37:30 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0E229288E; Wed, 1 Aug 2018 09:37:29 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 1 Aug 2018 11:37:28 +0200 Received: from lmecxl0923.lme.st.com (10.48.0.237) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 1 Aug 2018 11:37:28 +0200 From: Ludovic Barre To: Ulf Hansson , Rob Herring Subject: [PATCH 06/14] mmc: mmci: merge prepare data functions Date: Wed, 1 Aug 2018 11:36:53 +0200 Message-ID: <1533116221-380-7-git-send-email-ludovic.Barre@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533116221-380-1-git-send-email-ludovic.Barre@st.com> References: <1533116221-380-1-git-send-email-ludovic.Barre@st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.0.237] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-08-01_03:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180801_023740_234292_3FBC4A29 X-CRM114-Status: GOOD ( 13.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Torgue , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Ludovic Barre , Maxime Coquelin , Gerald Baeza , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ludovic Barre This patch merges the prepare data functions. This allows to define a single access to prepare data service. This prepares integration for mmci host ops. Signed-off-by: Ludovic Barre --- drivers/mmc/host/mmci.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 5646c2e6..e4d80f1 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -651,11 +651,16 @@ static int __mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data, return -ENOMEM; } -static inline int mmci_dma_prep_data(struct mmci_host *host, - struct mmc_data *data) +static inline int mmci_dma_prepare_data(struct mmci_host *host, + struct mmc_data *data, + bool next) { struct dmaengine_priv *dmae = host->dma_priv; + struct dmaengine_next *nd = &dmae->next_data; + if (next) + return __mmci_dma_prep_data(host, data, &nd->dma_chan, + &nd->dma_desc); /* Check if next job is already prepared. */ if (dmae->dma_current && dmae->dma_desc_current) return 0; @@ -665,22 +670,13 @@ static inline int mmci_dma_prep_data(struct mmci_host *host, &dmae->dma_desc_current); } -static inline int mmci_dma_prep_next(struct mmci_host *host, - struct mmc_data *data) -{ - struct dmaengine_priv *dmae = host->dma_priv; - struct dmaengine_next *nd = &dmae->next_data; - - return __mmci_dma_prep_data(host, data, &nd->dma_chan, &nd->dma_desc); -} - static int mmci_dma_start_data(struct mmci_host *host, unsigned int datactrl) { struct dmaengine_priv *dmae = host->dma_priv; struct mmc_data *data = host->data; int ret; - ret = mmci_dma_prep_data(host, host->data); + ret = mmci_dma_prepare_data(host, host->data, false); if (ret) return ret; @@ -737,7 +733,7 @@ static void mmci_pre_request(struct mmc_host *mmc, struct mmc_request *mrq) if (mmci_validate_data(host, data)) return; - if (!mmci_dma_prep_next(host, data)) + if (!mmci_dma_prepare_data(host, data, true)) data->host_cookie = ++host->next_cookie < 0 ? 1 : host->next_cookie; }