Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp631609imm; Wed, 1 Aug 2018 02:40:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf0tNcNd/udVT9htul+Uc/0sA6cG92iFs1boeenH3W2JnUiBKMoFGb8Q1iB0PyyKhS105/W X-Received: by 2002:a65:620b:: with SMTP id d11-v6mr24175397pgv.429.1533116418497; Wed, 01 Aug 2018 02:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533116418; cv=none; d=google.com; s=arc-20160816; b=YtYvMLe1iBO+/e46SPr/nmyNl6JYXIUmN2H9TYVz5AYg/JEDEgJoDUPQ8bSK9FKWYj OFARsqyyjn+MIGU3hdwFpHa3M2NqCdgxEpLdEjuHwmX/qcEV0tfXHUA/AY7bMeG5HNx4 n3tcc8YwsjOzu/C//DL0cBmyjRpUZgqO0e2frOCNP/LmHmwWFcZHERflXM2bkPQWDr2o Ap1kxiLsBioNwG69rljuRcK555Zbkqr+d0Me5djNI2VE9jcaECureLwZLMAAtpDLKi4y dA571qeC6x29PmlWCCxKFYrnQhuPoBDao6KnSa/+W8q9I7ruhSXw+TdpAT0AS4WvQYH4 rbPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=yVRus5xmnjNSAdxggCT81/oYsan+XQu6MSFR6dmN5Jk=; b=U7t9keTBukQh1UeCqnxodgXMv7B6QweX7HJiip1jRt1kK5ovBLzGUtHR2A4Y7RnXRq zAmf4bRC+/oJpt5ohTZvH5OZyAnG4htqhADEXXA3m/iJCF5LrGLnMmnAQsJ5qbn9UAcy Z2V2UCS6Bm3JNQ/np+Cx/yYLuwmc6s/Ns660ZBPDyQAQX05VjQwe13TQF80xpnLgCw6g Knlsluhb0G79X2ADIgBqsT6bxZhYdLpP6qBYbfGraOgVDxahA4rrt0oRuUfHpFMT6WY6 bz0I1jTYvDCn2o1YKjii5gjZ5jChwKECZxlw8s48XnoyxOgoaDa61IYHD0IIW93ksIdP EsSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f27-v6si17116502pgb.302.2018.08.01.02.40.02; Wed, 01 Aug 2018 02:40:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389105AbeHALWj (ORCPT + 99 others); Wed, 1 Aug 2018 07:22:39 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:42355 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389004AbeHALWh (ORCPT ); Wed, 1 Aug 2018 07:22:37 -0400 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 CC: Maxime Coquelin , Alexandre Torgue , Gerald Baeza , , , , , Ludovic Barre 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 Content-Type: text/plain X-Originating-IP: [10.48.0.237] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-01_03:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.7.4