@@ -1508,6 +1508,7 @@ static int mmc_select_timing(struct mmc_card *card)
static int mmc_hs200_tuning(struct mmc_card *card)
{
struct mmc_host *host = card->host;
+ int err;
/*
* Timing should be adjusted to the HS400 target
@@ -1518,7 +1519,11 @@ static int mmc_hs200_tuning(struct mmc_card *card)
if (host->ops->prepare_hs400_tuning)
host->ops->prepare_hs400_tuning(host, &host->ios);
- return mmc_execute_tuning(card);
+ err = mmc_execute_tuning(card);
+ if (err)
+ return err;
+
+ return mmc_select_hs400(card);
}
/*
@@ -1733,10 +1738,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
err = mmc_hs200_tuning(card);
if (err)
goto free_card;
-
- err = mmc_select_hs400(card);
- if (err)
- goto free_card;
} else if (!mmc_card_hs400es(card)) {
/* Select the desired bus width optionally */
err = mmc_select_bus_width(card);
Call mmc_select_hs400() from mmc_hs200_tuning(). This should have no run-time effect as the existing call to mmc_select_hs400() is right after a call to mmc_hs200_tuning() in mmc_init_card() and that is the only caller of mmc_hs200_tuning(). This is in preparation for adding a new mmc_host_opp to be called after tuning and selecting HS400 - or in other words, after mmc_execute_tuning() and mmc_select_hs400(). Signed-off-by: Simon Horman <horms+renesas@verge.net.au> --- v4 - New patch --- drivers/mmc/core/mmc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)