mmc: tmio: always get number of taps
authorMasaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
Fri, 17 Mar 2017 09:04:50 +0000 (10:04 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 24 Apr 2017 19:41:41 +0000 (21:41 +0200)
Current code gets number of taps only once and keeps the value. This is
not correct, we need to obtain it every time before executing tuning,
so remove the outer if-block.

Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
[wsa: extracted from a larger patch and reworded commit message]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/tmio_mmc_pio.c

index 5b01d22932cdbfc8958c0dfdf672f69ca3294871..a2d92f10501bdd9d7e2b1063d865775e20a059c2 100644 (file)
@@ -815,16 +815,14 @@ static int tmio_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
        struct tmio_mmc_host *host = mmc_priv(mmc);
        int i, ret = 0;
 
-       if (!host->tap_num) {
-               if (!host->init_tuning || !host->select_tuning)
-                       /* Tuning is not supported */
-                       goto out;
+       if (!host->init_tuning || !host->select_tuning)
+               /* Tuning is not supported */
+               goto out;
 
-               host->tap_num = host->init_tuning(host);
-               if (!host->tap_num)
-                       /* Tuning is not supported */
-                       goto out;
-       }
+       host->tap_num = host->init_tuning(host);
+       if (!host->tap_num)
+               /* Tuning is not supported */
+               goto out;
 
        if (host->tap_num * 2 >= sizeof(host->taps) * BITS_PER_BYTE) {
                dev_warn_once(&host->pdev->dev,