mmc: core: Use pm_runtime_resume_and_get() to replace open coding

use pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
pm_runtime_put_noidle. this change is just to simplify the code, no
actual functional changes

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Link: https://lore.kernel.org/r/1621513304-27824-1-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Tian Tao 2021-05-20 20:21:44 +08:00 committed by Ulf Hansson
parent 83c4930256
commit 05335af1e8
1 changed files with 2 additions and 4 deletions

View File

@ -937,11 +937,9 @@ static void mmc_sdio_detect(struct mmc_host *host)
/* Make sure card is powered before detecting it */
if (host->caps & MMC_CAP_POWER_OFF_CARD) {
err = pm_runtime_get_sync(&host->card->dev);
if (err < 0) {
pm_runtime_put_noidle(&host->card->dev);
err = pm_runtime_resume_and_get(&host->card->dev);
if (err < 0)
goto out;
}
}
mmc_claim_host(host);