summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-08-25 14:52:36 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2016-08-28 12:39:48 +0900
commit4eb008460cf4b9da316d97874a32680209324107 (patch)
tree648fc7a5fd42d72b141020c243d5fbe5a8890f04 /drivers
parent3937404f8b80eb482661a182ebb774e96356c607 (diff)
mmc: uniphier-sd: move uniphier_sd_init() below
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 <yamada.masahiro@socionext.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/uniphier-sd.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/mmc/uniphier-sd.c b/drivers/mmc/uniphier-sd.c
index b8e784f59c..b254c70857 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 /