From: Tian Tao Date: Thu, 20 May 2021 12:21:44 +0000 (+0800) Subject: mmc: core: Use pm_runtime_resume_and_get() to replace open coding X-Git-Tag: accepted/tizen/unified/20230118.172025~7013^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05335af1e82a3ce2a7d410c7b1695a3c4ec37ea9;p=platform%2Fkernel%2Flinux-rpi.git 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 Link: https://lore.kernel.org/r/1621513304-27824-1-git-send-email-tiantao6@hisilicon.com Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 3eb94ac..68edf7a 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -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);