summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2020-04-08 11:46:37 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2020-05-28 11:20:57 +0200
commitec4fc1acf363985882c37278bfe8881c4e0ec121 (patch)
treefc30c903186d0c170f44e4852863875543541f18 /drivers/mmc
parent92fa2a567d520ed71bb810a3b24c6b60f8ef329c (diff)
downloadlinux-ec4fc1acf363985882c37278bfe8881c4e0ec121.tar.gz
linux-ec4fc1acf363985882c37278bfe8881c4e0ec121.tar.bz2
linux-ec4fc1acf363985882c37278bfe8881c4e0ec121.zip
mmc: renesas_sdhi: clarify handling of selecting TAPs
The comment and the define about how TAPs are selected were confusing to me because the good TAP was only valid if it was bigger than a *_MAX_* value. Rename the define and adapt the comment to what really happens. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Link: https://lore.kernel.org/r/20200408094638.10375-3-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/renesas_sdhi_core.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index f5d174d86117..0dbee47eafa1 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -422,7 +422,7 @@ static int renesas_sdhi_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_io
return 0;
}
-#define SH_MOBILE_SDHI_MAX_TAP 3
+#define SH_MOBILE_SDHI_MIN_TAP_ROW 3
static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
{
@@ -446,9 +446,9 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
}
/*
- * Find the longest consecutive run of successful probes. If that
- * is more than SH_MOBILE_SDHI_MAX_TAP probes long then use the
- * center index as the tap.
+ * Find the longest consecutive run of successful probes. If that
+ * is at least SH_MOBILE_SDHI_MIN_TAP_ROW probes long then use the
+ * center index as the tap, otherwise bail out.
*/
bitmap_for_each_set_region(priv->taps, rs, re, 0, taps_size) {
if (re - rs > tap_cnt) {
@@ -458,7 +458,7 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
}
}
- if (tap_cnt >= SH_MOBILE_SDHI_MAX_TAP)
+ if (tap_cnt >= SH_MOBILE_SDHI_MIN_TAP_ROW)
priv->tap_set = (tap_start + tap_end) / 2 % priv->tap_num;
else
return -EIO;