From patchwork Fri Feb 17 02:56:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 9578669 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 C27D9600C5 for ; Fri, 17 Feb 2017 03:00:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B13D928687 for ; Fri, 17 Feb 2017 03:00:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A472F28691; Fri, 17 Feb 2017 03:00:17 +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 99F0528687 for ; Fri, 17 Feb 2017 03:00:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754663AbdBQDAQ (ORCPT ); Thu, 16 Feb 2017 22:00:16 -0500 Received: from lucky1.263xmail.com ([211.157.147.131]:35609 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754293AbdBQDAP (ORCPT ); Thu, 16 Feb 2017 22:00:15 -0500 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.190]) by lucky1.263xmail.com (Postfix) with ESMTP id 250178F48F; Fri, 17 Feb 2017 11:00:11 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 1BDCD3E0; Fri, 17 Feb 2017 11:00:09 +0800 (CST) X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: jh80.chung@samsung.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: <0e5b546e8170da36bafa895ea6a8fd30> X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from unknown (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith SMTP id 18502FI11PZ; Fri, 17 Feb 2017 11:00:11 +0800 (CST) From: Shawn Lin To: Jaehoon Chung Cc: Ulf Hansson , linux-mmc@vger.kernel.org, Shawn Lin Subject: [PATCH 3/7] mmc: dw_mmc: move dw_mci_ctrl_reset forward to avoid declaration Date: Fri, 17 Feb 2017 10:56:41 +0800 Message-Id: <1487300205-202825-4-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1487300205-202825-1-git-send-email-shawn.lin@rock-chips.com> References: <1487300205-202825-1-git-send-email-shawn.lin@rock-chips.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 No functional change intended. Signed-off-by: Shawn Lin --- drivers/mmc/host/dw_mmc.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 20fe96c8..e87fd95 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -106,7 +106,6 @@ struct idmac_desc { /* Each descriptor can transfer up to 4KB of data in chained mode */ #define DW_MCI_DESC_DATA_LENGTH 0x1000 -static bool dw_mci_ctrl_reset(struct dw_mci *host, u32 reset); static int dw_mci_card_busy(struct mmc_host *mmc); static int dw_mci_get_cd(struct mmc_host *mmc); @@ -234,6 +233,26 @@ static void dw_mci_init_debugfs(struct dw_mci_slot *slot) #endif /* defined(CONFIG_DEBUG_FS) */ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg); +static bool dw_mci_ctrl_reset(struct dw_mci *host, u32 reset) +{ + u32 ctrl; + + ctrl = mci_readl(host, CTRL); + ctrl |= reset; + mci_writel(host, CTRL, ctrl); + + /* wait till resets clear */ + if (readl_poll_timeout_atomic(host->regs + SDMMC_CTRL, ctrl, + !(ctrl & reset), + 1, 500 * USEC_PER_MSEC)) { + dev_err(host->dev, + "Timeout resetting block (ctrl reset %#x)\n", + ctrl & reset); + return false; + } + + return true; +} static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd) { @@ -2880,27 +2899,6 @@ static void dw_mci_init_dma(struct dw_mci *host) host->use_dma = TRANS_MODE_PIO; } -static bool dw_mci_ctrl_reset(struct dw_mci *host, u32 reset) -{ - u32 ctrl; - - ctrl = mci_readl(host, CTRL); - ctrl |= reset; - mci_writel(host, CTRL, ctrl); - - /* wait till resets clear */ - if (readl_poll_timeout_atomic(host->regs + SDMMC_CTRL, ctrl, - !(ctrl & reset), - 1, 500 * USEC_PER_MSEC)) { - dev_err(host->dev, - "Timeout resetting block (ctrl reset %#x)\n", - ctrl & reset); - return false; - } - - return true; -} - static void dw_mci_cmd11_timer(unsigned long arg) { struct dw_mci *host = (struct dw_mci *)arg;