Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp438403imm; Fri, 21 Sep 2018 02:48:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZNo4jyA2V+R7q3tDIxi4NePROR8+AJQr5FohDyGDc9ERxiymyhP9VBjChNsz83RPXYJLND X-Received: by 2002:a65:520d:: with SMTP id o13-v6mr39649816pgp.282.1537523283741; Fri, 21 Sep 2018 02:48:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537523283; cv=none; d=google.com; s=arc-20160816; b=SZQRh+rj+ifQMN/JSHielLQRwIZD0xGe845R8cfKRiWIWbcarwSOvepzqMo0wEkZIk grr4QOpHQgeDkopBI6NWeTU/VG495xHXgjpC7O+JwKQOnNi3cjKNed6+aM/LEP4+9TvT 179VHVay+Ojn1jHzMIHmE4abJZLG8+IyTWv8wA+85Y5+9S8NYVV7pe4Na+auptQZdmF9 8rH/UG8ASlyHKxxWXg36h8VxiX0UjLunAeg842X19s4iWBuIcuD90Go044lxhOMR3G1J yRkcK4ocfljPa1TN/mta9CZ2/AS7xLCup3CJZT+bJOtq1+5DnAMB996eHABdUIVy9nWQ 94NA== 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=K07lDPuFWxs+0Ql1OQItT2VsCQIHt7hvn1wpJW23f5c=; b=b7WdZxIhUbusGLnCWCj/5Sqp5Aj2te10duCOfVyYDSIij85hKj02BPl/qfiHAXcgAF b7vNt/2OV+kS1I0YBKffnUbqCPLc6nbWe42p6gMXS+iTE7fCKFrmJglOcGO8Txgd+rYs Wv03yeXmJtoKLPa0KxtRU9uyCLUYQdC/a7X+sZrgqlefWitywSkuNLb/1AwXujv6kFNg +oENh0Y2Mo6KcmnWoxqZXPgSGpweCAvY01uAMIeS427Zl7xuoVepiYyZEh/UKX6r9IUy bUbUTnxLrmX2isJ3Ph9LhIL+tl/HDtkCIgNfARdAmfrWFSixfi0nQ8mNJ+GvYtKxBRE7 xPQg== 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 a98-v6si27966725pla.396.2018.09.21.02.47.42; Fri, 21 Sep 2018 02:48:03 -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 S2389597AbeIUPfM (ORCPT + 99 others); Fri, 21 Sep 2018 11:35:12 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:43196 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389010AbeIUPe5 (ORCPT ); Fri, 21 Sep 2018 11:34:57 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w8L9jK4O001508; Fri, 21 Sep 2018 11:46:37 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2mmkn0u88j-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 21 Sep 2018 11:46:37 +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 AC9FF42; Fri, 21 Sep 2018 09:46:36 +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 7422D2ACC; Fri, 21 Sep 2018 09:46:36 +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; Fri, 21 Sep 2018 11:46:36 +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; Fri, 21 Sep 2018 11:46:35 +0200 From: Ludovic Barre To: Ulf Hansson , Rob Herring CC: Maxime Coquelin , Alexandre Torgue , , Gerald Baeza , Loic Pallardy , , , , , , Ludovic Barre Subject: [PATCH V2 06/27] mmc: mmci: merge prepare data functions Date: Fri, 21 Sep 2018 11:46:00 +0200 Message-ID: <1537523181-14578-7-git-send-email-ludovic.Barre@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537523181-14578-1-git-send-email-ludovic.Barre@st.com> References: <1537523181-14578-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-09-21_04:,, 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 --- change v2: -rename to mmci_prep/unprep_data 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 43f2a1a..0cbe71c 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -652,10 +652,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; @@ -665,22 +669,13 @@ 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) { struct mmci_dmae_priv *dmae = host->dma_priv; struct mmc_data *data = host->data; int ret; - ret = mmci_dma_prep_data(host, host->data); + ret = mmci_dma_prep_data(host, host->data, false); if (ret) return ret; @@ -737,7 +732,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