Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3502750imm; Mon, 8 Oct 2018 05:13:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV61ygz8PkY5B4QN3k7VuVfUi43EB1y1ExaKCHXNUdcL8Z1ris0WBldMP7MBI5/kakcsQ8BMP X-Received: by 2002:a63:8543:: with SMTP id u64-v6mr11880897pgd.373.1539000806692; Mon, 08 Oct 2018 05:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539000806; cv=none; d=google.com; s=arc-20160816; b=i/ujoNwmNKNkyIMbrzUQcuT7tF8RVRjp/gXA7dDo1NqVQlVikpOCsFj1SJwF9+kcsT pR2JDA+pTvpJbTUO25cDogrJ4nG0drykrnaGLtBLypx/s+BWE1ZRyYPVDNid2tWilLYN htGS2reIXweiAL/JIv5xkGJNjnYLwkZ3QCkjAvhQAOQsnR3UllWNykVhGyr9gHzC70Rn ijc3cOCJ5fhPM/XDCZwUg2eIRvVBx2Z/tS9omn+id7caTIPUm5TVDYVltWApRj/zv9K3 A2GCEKNJHv3ATKoQ4SaVR1fd2xWYUxJ/019ZekTu4NSnbn0kU9jKPCYVpEXQqyi0c0U3 eaEg== 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; bh=tXmBLw8TL66vIyE+jZJ09ENtt7sMRYlAASjmqcM0O1E=; b=ng2uIXfE/xhP+cj6PJnlGGfzoa5JNMO1V6aw27rtg8hDsy42pgPn0dh60zWAyFmlWv EoDbiQYrcngj0yTpS7Z1OtVST/lU9M27c8/yrT2lzAYXOmcrFpDP0IY/NTCUs9J1jUN2 PeBjzdyTH4fgt6E4RLo0eno3tVgQp7gJKIgs2pjIRZRYoeNAv/qnRc18IQkBwk9LCGoG n+OVwq/VBxXnVkODt0H81BRmNRIM7YeDMbUM8gN3ydMf4CH3D6aS/3SOHQ2XlzgAUIGX c57Gz41ENPEDTAhdkK5wuO3RDaVlk/I2V5aFJ2FP0UcsrYkwn1Smf5fiCHkxdZRMDh5N taWA== 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 l9-v6si18015414pfi.179.2018.10.08.05.13.11; Mon, 08 Oct 2018 05:13:26 -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 S1727939AbeJHTV1 (ORCPT + 99 others); Mon, 8 Oct 2018 15:21:27 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:23695 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726982AbeJHTV0 (ORCPT ); Mon, 8 Oct 2018 15:21:26 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w98C4Xr6024547; Mon, 8 Oct 2018 14:09:36 +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 2mxjgxjvap-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 08 Oct 2018 14:09:36 +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 3B53D38; Mon, 8 Oct 2018 12:09:35 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 116C12D01; Mon, 8 Oct 2018 12:09:35 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 8 Oct 2018 14:09:34 +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; Mon, 8 Oct 2018 14:09:34 +0200 From: Ludovic Barre To: Ulf Hansson , Rob Herring CC: , Maxime Coquelin , Alexandre Torgue , , , , , , Ludovic Barre Subject: [PATCH V6 03/23] mmc: mmci: merge prepare data functions Date: Mon, 8 Oct 2018 14:08:35 +0200 Message-ID: <1539000535-13261-4-git-send-email-ludovic.Barre@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539000535-13261-1-git-send-email-ludovic.Barre@st.com> References: <1539000535-13261-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-10-08_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 | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 922a47b..f862a1b 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -683,10 +683,14 @@ static int __mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data, } static inline int mmci_dma_prep_data(struct mmci_host *host, - struct mmc_data *data) + struct mmc_data *data, + bool next) { struct mmci_dmae_priv *dmae = host->dma_priv; + struct mmci_dmae_next *nd = &dmae->next_data; + if (next) + return __mmci_dma_prep_data(host, data, &nd->chan, &nd->desc); /* Check if next job is already prepared. */ if (dmae->cur && dmae->desc_current) return 0; @@ -696,15 +700,6 @@ static inline int mmci_dma_prep_data(struct mmci_host *host, &dmae->desc_current); } -static inline int mmci_dma_prep_next(struct mmci_host *host, - struct mmc_data *data) -{ - struct mmci_dmae_priv *dmae = host->dma_priv; - struct mmci_dmae_next *nd = &dmae->next_data; - - return __mmci_dma_prep_data(host, data, &nd->chan, &nd->desc); -} - static int mmci_dma_start_data(struct mmci_host *host, unsigned int datactrl) { int ret; @@ -714,7 +709,7 @@ static int mmci_dma_start_data(struct mmci_host *host, unsigned int datactrl) if (!host->use_dma) return -EINVAL; - ret = mmci_dma_prep_data(host, host->data); + ret = mmci_dma_prep_data(host, host->data, false); if (ret) return ret; @@ -774,7 +769,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_prep_data(host, data, true)) data->host_cookie = ++host->next_cookie < 0 ? 1 : host->next_cookie; } -- 2.7.4