mmc: core: clear 'doing_init_tune' also after failures

Reorganize the code, so that the flag is always cleared independently of
a good or bad case.

Fixes: 97a7d87e96 ("mmc: core: add a 'doing_init_tune' flag and a 'mmc_doing_tune' helper")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/20200914112845.21855-1-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Wolfram Sang 2020-09-14 13:28:45 +02:00 committed by Ulf Hansson
parent a49e391c49
commit 878dbe426a

View File

@ -1766,14 +1766,14 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
host->doing_init_tune = 1; host->doing_init_tune = 1;
err = mmc_hs200_tuning(card); err = mmc_hs200_tuning(card);
if (err) if (!err)
goto free_card;
err = mmc_select_hs400(card); err = mmc_select_hs400(card);
if (err)
goto free_card;
host->doing_init_tune = 0; host->doing_init_tune = 0;
if (err)
goto free_card;
} else if (!mmc_card_hs400es(card)) { } else if (!mmc_card_hs400es(card)) {
/* Select the desired bus width optionally */ /* Select the desired bus width optionally */
err = mmc_select_bus_width(card); err = mmc_select_bus_width(card);