diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 50d1eb11eaeb..351fc78d0d7c 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1908,11 +1908,12 @@ static void mmc_remove(struct mmc_host *host) BUG_ON(!host->card); unregister_reboot_notifier(&host->card->reboot_notify); + + mmc_exit_clk_scaling(host); mmc_remove_card(host->card); mmc_claim_host(host); host->card = NULL; - mmc_exit_clk_scaling(host); mmc_release_host(host); } diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 165b6f2b729e..092b447ae901 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1119,11 +1119,11 @@ static void mmc_sd_remove(struct mmc_host *host) BUG_ON(!host); BUG_ON(!host->card); + mmc_exit_clk_scaling(host); mmc_remove_card(host->card); mmc_claim_host(host); host->card = NULL; - mmc_exit_clk_scaling(host); mmc_release_host(host); }