From patchwork Mon Jun 5 04:41:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9765479 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 0DB6160353 for ; Mon, 5 Jun 2017 04:41:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F41F727F10 for ; Mon, 5 Jun 2017 04:41:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8F0A27FA5; Mon, 5 Jun 2017 04:41:43 +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 B9B6727FA6 for ; Mon, 5 Jun 2017 04:41:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751311AbdFEEll (ORCPT ); Mon, 5 Jun 2017 00:41:41 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:32919 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751276AbdFEElj (ORCPT ); Mon, 5 Jun 2017 00:41:39 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20170605044138epoutp035349082aa15b19252cc39150f8a6ece7~FIA6RdQf31256712567epoutp03f; Mon, 5 Jun 2017 04:41:38 +0000 (GMT) Received: from epsmges1p1.samsung.com (unknown [182.195.40.68]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20170605044137epcas1p364e67a4f477ca2ef0655dc864ddeb920~FIA6C5cKs0828108281epcas1p3P; Mon, 5 Jun 2017 04:41:37 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id B8.FC.11252.101E4395; Mon, 5 Jun 2017 13:41:37 +0900 (KST) Received: from epsmgms2p1.samsung.com (unknown [182.195.42.79]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20170605044137epcas1p413b27e4b2f3db83c1623acf4cc2b9cdc~FIA5vesoU2526325263epcas1p4R; Mon, 5 Jun 2017 04:41:37 +0000 (GMT) X-AuditID: b6c32a35-f79806d000002bf4-d9-5934e101c0bf Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 90.F1.02179.101E4395; Mon, 5 Jun 2017 13:41:37 +0900 (KST) Received: from localhost.localdomain ([10.113.62.216]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OR200A0S51CWR90@mmp1.samsung.com>; Mon, 05 Jun 2017 13:41:37 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, shawn.lin@rock-chips.com, Jaehoon Chung Subject: [PATCH 3/6] mmc: dw_mmc: change the array of slots Date: Mon, 05 Jun 2017 13:41:32 +0900 Message-id: <20170605044135.18304-4-jh80.chung@samsung.com> X-Mailer: git-send-email 2.10.2 In-reply-to: <20170605044135.18304-1-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFKsWRmVeSWpSXmKPExsWy7bCmgS7jQ5NIg7nzDS1u/GpjtTjyv5/R 4s6T9awWx9eGO7B43Lm2h83j76z9LB59W1YxenzeJBfAEpVqk5GamJJapJCal5yfkpmXbqvk HRzvHG9qZmCoa2hpYa6kkJeYm2qr5OIToOuWmQO0UUmhLDGnF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BE4k5h+azQ9hiEhfurWfrYuTiEBLYxiixpvUrE4Tzg1Hiw5znTCBVbAI6Etu/ HQezRQRkJX7+ucAGYjMLxEksOvoTaBIHh7CAtcTFM9IgYRYBVYktR84xgti8QOEpDV+YIJbJ Syw8fwTM5hSwkVh99xGYLQRUc6W9iWkCI+8CRoZVjFypBcW56bnFRgWGmxiBwbjtsJb/DsYf Z6MPMQpwMCrx8EpkmkQKsSaWFVfmHmKU4GBWEuEtvg4U4k1JrKxKLcqPLyrNSS0+xGgKdMpE ZinR5HxgpOSVxBuaWBqZGJiZGRoZGJspifNOCPwSISSQnliSmp2aWpBaBNPHxMEp1cDILnPI O+LuA3u52spJ+Q9+Pmje+37ZbGMD/jsPz7OyX65S0Q3YZrb8CJufxpmHTr9vf/Obx5n1ZJLo t+bKPYFp0+xkuWL3iy5bzrtlSXGe5X9ePa8tF5w9lz34M2fvhAOTTy2cX/i8eOtWti5e+d23 1LMtzu8KUxaWk3hTEvXSoqBFe0HT233aSizFGYmGWsxFxYkAA4n3alwCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170605044137epcas1p413b27e4b2f3db83c1623acf4cc2b9cdc X-Msg-Generator: CA X-Sender-IP: 182.195.42.79 X-Local-Sender: =?UTF-8?B?7KCV7J6s7ZuIG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbU2VuaW9yIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?SmFlaG9vbiBDaHVuZxtUaXplbiBQbGF0Zm9ybSBMYWIuG1Nh?= =?UTF-8?B?bXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG1RFTEUbQzEwVjgxMTE=?= CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170605044137epcas1p413b27e4b2f3db83c1623acf4cc2b9cdc X-RootMTR: 20170605044137epcas1p413b27e4b2f3db83c1623acf4cc2b9cdc References: <20170605044135.18304-1-jh80.chung@samsung.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It doesn't need to use the array of slots anymore. Signed-off-by: Jaehoon Chung --- drivers/mmc/host/dw_mmc.c | 21 +++++++++------------ drivers/mmc/host/dw_mmc.h | 4 +--- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 1b415da..8ed3c87 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2563,8 +2563,7 @@ static void dw_mci_cmd_interrupt(struct dw_mci *host, u32 status) static void dw_mci_handle_cd(struct dw_mci *host) { - int i = 0; - struct dw_mci_slot *slot = host->slot[i]; + struct dw_mci_slot *slot = host->slot; if (slot->mmc->ops->card_event) slot->mmc->ops->card_event(slot->mmc); @@ -2576,8 +2575,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) { struct dw_mci *host = dev_id; u32 pending; - int i = 0; - struct dw_mci_slot *slot = host->slot[i]; + struct dw_mci_slot *slot = host->slot; pending = mci_readl(host, MINTSTS); /* read-only mask reg */ @@ -2707,7 +2705,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) slot->sdio_id = host->sdio_id0 + id; slot->mmc = mmc; slot->host = host; - host->slot[id] = slot; + host->slot = slot; mmc->ops = &dw_mci_ops; if (device_property_read_u32_array(host->dev, "clock-freq-min-max", @@ -2807,7 +2805,7 @@ static void dw_mci_cleanup_slot(struct dw_mci_slot *slot, unsigned int id) { /* Debugfs stuff is cleaned up by mmc core */ mmc_remove_host(slot->mmc); - slot->host->slot[id] = NULL; + slot->host->slot = NULL; mmc_free_host(slot->mmc); } @@ -2998,14 +2996,13 @@ static void dw_mci_enable_cd(struct dw_mci *host) { unsigned long irqflags; u32 temp; - int i = 0; struct dw_mci_slot *slot; /* * No need for CD if all slots have a non-error GPIO * as well as broken card detection is found. */ - slot = host->slot[i]; + slot = host->slot; if (slot->mmc->caps & MMC_CAP_NEEDS_POLL) return; @@ -3233,8 +3230,8 @@ void dw_mci_remove(struct dw_mci *host) int i = 0; dev_dbg(host->dev, "remove slot %d\n", i); - if (host->slot[i]) - dw_mci_cleanup_slot(host->slot[i], i); + if (host->slot) + dw_mci_cleanup_slot(host->slot, i); mci_writel(host, RINTSTS, 0xFFFFFFFF); mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */ @@ -3277,9 +3274,9 @@ EXPORT_SYMBOL(dw_mci_runtime_suspend); int dw_mci_runtime_resume(struct device *dev) { - int i = 0, ret = 0; + int ret = 0; struct dw_mci *host = dev_get_drvdata(dev); - struct dw_mci_slot *slot = host->slot[i]; + struct dw_mci_slot *slot = host->slot; if (host->cur_slot && (mmc_can_gpio_cd(host->cur_slot->mmc) || diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h index ce34736..1ec8f40 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h @@ -20,8 +20,6 @@ #include #include -#define MAX_MCI_SLOTS 2 - enum dw_mci_state { STATE_IDLE = 0, STATE_SENDING_CMD, @@ -215,7 +213,7 @@ struct dw_mci { void *priv; struct clk *biu_clk; struct clk *ciu_clk; - struct dw_mci_slot *slot[MAX_MCI_SLOTS]; + struct dw_mci_slot *slot; /* FIFO push and pull */ int fifo_depth;