mmc: core: Move calls to ->prepare_hs400_tuning() closer to mmc code
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 22 May 2018 14:26:26 +0000 (16:26 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 29 May 2018 10:24:26 +0000 (12:24 +0200)
Move the calls to ->prepare_hs400_tuning(), from mmc_retune() into
mmc_hs400_to_hs200(), as it better belongs there, rather than being generic
to all type of cards.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
drivers/mmc/core/host.c
drivers/mmc/core/mmc.c

index c57ffff18e37f6a9ad0dc89d879bd32aefd79d11..abf9e884386c4cc42edee4113bb1a989167dba55 100644 (file)
@@ -143,9 +143,6 @@ int mmc_retune(struct mmc_host *host)
                        goto out;
 
                return_to_hs400 = true;
-
-               if (host->ops->prepare_hs400_tuning)
-                       host->ops->prepare_hs400_tuning(host, &host->ios);
        }
 
        err = mmc_execute_tuning(host->card);
index 57a8bd39cdde58d658913a89be4290e0cc0dbccc..4466f5de54d44fcabed3d43537b15f41e44af8d6 100644 (file)
@@ -1282,6 +1282,10 @@ int mmc_hs400_to_hs200(struct mmc_card *card)
 
        mmc_set_bus_speed(card);
 
+       /* Prepare tuning for HS400 mode. */
+       if (host->ops->prepare_hs400_tuning)
+               host->ops->prepare_hs400_tuning(host, &host->ios);
+
        return 0;
 
 out_err: