diff mbox series

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

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

Commit Message

Tian Tao May 21, 2021, 12:59 a.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/host/sdhci_am654.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Ulf Hansson May 24, 2021, 2:10 p.m. UTC | #1
On Fri, 21 May 2021 at 02:59, 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/host/sdhci_am654.c | 6 ++----

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

>

> diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c

> index 1fad6e4..f654afb 100644

> --- a/drivers/mmc/host/sdhci_am654.c

> +++ b/drivers/mmc/host/sdhci_am654.c

> @@ -809,11 +809,9 @@ static int sdhci_am654_probe(struct platform_device *pdev)

>

>         /* Clocks are enabled using pm_runtime */

>         pm_runtime_enable(dev);

> -       ret = pm_runtime_get_sync(dev);

> -       if (ret < 0) {

> -               pm_runtime_put_noidle(dev);

> +       ret = pm_runtime_resume_and_get(dev);

> +       if (ret)

>                 goto pm_runtime_disable;

> -       }

>

>         base = devm_platform_ioremap_resource(pdev, 1);

>         if (IS_ERR(base)) {

> --

> 2.7.4

>
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c
index 1fad6e4..f654afb 100644
--- a/drivers/mmc/host/sdhci_am654.c
+++ b/drivers/mmc/host/sdhci_am654.c
@@ -809,11 +809,9 @@  static int sdhci_am654_probe(struct platform_device *pdev)
 
 	/* Clocks are enabled using pm_runtime */
 	pm_runtime_enable(dev);
-	ret = pm_runtime_get_sync(dev);
-	if (ret < 0) {
-		pm_runtime_put_noidle(dev);
+	ret = pm_runtime_resume_and_get(dev);
+	if (ret)
 		goto pm_runtime_disable;
-	}
 
 	base = devm_platform_ioremap_resource(pdev, 1);
 	if (IS_ERR(base)) {