diff mbox series

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

Message ID 1621513304-27824-1-git-send-email-tiantao6@hisilicon.com
State New
Headers show
Series mmc: core: Use pm_runtime_resume_and_get() to replace open coding | expand

Commit Message

Tian Tao May 20, 2021, 12:21 p.m. UTC
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>
---
 drivers/mmc/core/sdio.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Ulf Hansson May 24, 2021, 2:10 p.m. UTC | #1
On Thu, 20 May 2021 at 14:21, Tian Tao <tiantao6@hisilicon.com> wrote:
>

> 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>


Applied for next, thanks!

Kind regards
Uffe


> ---

>  drivers/mmc/core/sdio.c | 6 ++----

>  1 file changed, 2 insertions(+), 4 deletions(-)

>

> 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);

> --

> 2.7.4

>
diff mbox series

Patch

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);