From patchwork Thu Aug 25 05:52:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 74646 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp666846qga; Wed, 24 Aug 2016 22:52:01 -0700 (PDT) X-Received: by 10.194.95.105 with SMTP id dj9mr5979907wjb.20.1472104321519; Wed, 24 Aug 2016 22:52:01 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id li10si12192101wjb.23.2016.08.24.22.52.01; Wed, 24 Aug 2016 22:52:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 56B35A756B; Thu, 25 Aug 2016 07:51:28 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Rzz75bZf_3s9; Thu, 25 Aug 2016 07:51:28 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 62B70A7574; Thu, 25 Aug 2016 07:51:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0C7C94BDBD for ; Thu, 25 Aug 2016 07:51:18 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2xpR6kZu3hYn for ; Thu, 25 Aug 2016 07:51:17 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by theia.denx.de (Postfix) with ESMTPS id 41EC74B9AD for ; Thu, 25 Aug 2016 07:51:08 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id u7P5oZi2017421; Thu, 25 Aug 2016 14:50:36 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com u7P5oZi2017421 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1472104236; bh=3G0+dk1qCNvR7pgqUiGB/da+s72Q8ZylgMlswHq4Q+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kiBHDbz9iXXiYVytonDjB2Q+7GY6KN8wYlhfc3Khtgp23i86yosNEkjN+coM3CMrc 1iIs9lRuZDKHpxLnqGe79Z/jIU6WQXRAQwG3lL+oYKX4MKN1UlfyaaAw3lt5kgj/L4 Ml+XomB9Gb7Gf3A8vHDbLrCREXzgOrZe/zbd5NyjFsOLhVjuNkkd+OIcSI9R3c+k0Y 7hvpxDI1nXE8X7OdcI7J2FU8nf1zutmFwc7quqhGrjPhs3eRGnbKFLsZDOr9w9Pjzz MsbviiNvhHWoFzNjl5kOYbSmoMuRyMl9llrrJSfvHd8trPwbdXMP6ra7Z5jg7SzCdl oAfTAQZYcs32w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 25 Aug 2016 14:52:36 +0900 Message-Id: <1472104359-23551-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472104359-23551-1-git-send-email-yamada.masahiro@socionext.com> References: <1472104359-23551-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 2/5] mmc: uniphier-sd: move uniphier_sd_init() below X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" No more reason to define this function above the ops structure. Move it near the caller. Also, change its return type to void because it never fails. Signed-off-by: Masahiro Yamada --- drivers/mmc/uniphier-sd.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/drivers/mmc/uniphier-sd.c b/drivers/mmc/uniphier-sd.c index b8e784f..b254c70 100644 --- a/drivers/mmc/uniphier-sd.c +++ b/drivers/mmc/uniphier-sd.c @@ -600,7 +600,24 @@ static int uniphier_sd_set_ios(struct udevice *dev) return 0; } -static int uniphier_sd_init(struct uniphier_sd_priv *priv) +static int uniphier_sd_get_cd(struct udevice *dev) +{ + struct uniphier_sd_priv *priv = dev_get_priv(dev); + + if (priv->caps & UNIPHIER_SD_CAP_NONREMOVABLE) + return 1; + + return !!(readl(priv->regbase + UNIPHIER_SD_INFO1) & + UNIPHIER_SD_INFO1_CD); +} + +static const struct dm_mmc_ops uniphier_sd_ops = { + .send_cmd = uniphier_sd_send_cmd, + .set_ios = uniphier_sd_set_ios, + .get_cd = uniphier_sd_get_cd, +}; + +static void uniphier_sd_host_init(struct uniphier_sd_priv *priv) { u32 tmp; @@ -628,27 +645,8 @@ static int uniphier_sd_init(struct uniphier_sd_priv *priv) tmp |= UNIPHIER_SD_DMA_MODE_ADDR_INC; writel(tmp, priv->regbase + UNIPHIER_SD_DMA_MODE); } - - return 0; -} - -static int uniphier_sd_get_cd(struct udevice *dev) -{ - struct uniphier_sd_priv *priv = dev_get_priv(dev); - - if (priv->caps & UNIPHIER_SD_CAP_NONREMOVABLE) - return 1; - - return !!(readl(priv->regbase + UNIPHIER_SD_INFO1) & - UNIPHIER_SD_INFO1_CD); } -static const struct dm_mmc_ops uniphier_sd_ops = { - .send_cmd = uniphier_sd_send_cmd, - .set_ios = uniphier_sd_set_ios, - .get_cd = uniphier_sd_get_cd, -}; - static int uniphier_sd_probe(struct udevice *dev) { struct uniphier_sd_priv *priv = dev_get_priv(dev); @@ -715,7 +713,7 @@ static int uniphier_sd_probe(struct udevice *dev) priv->caps |= UNIPHIER_SD_CAP_DIV1024; } - uniphier_sd_init(priv); + uniphier_sd_host_init(priv); priv->cfg.voltages = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34; priv->cfg.f_min = priv->mclk /