2022-04-12 22:10:41

by CGEL

[permalink] [raw]
Subject: [PATCH] nvmem: qfprom: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

From: Minghao Chi <[email protected]>

Using pm_runtime_resume_and_get is more appropriate
for simplifing code

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Minghao Chi <[email protected]>
---
drivers/nvmem/qfprom.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c
index 162132c7dab9..c1e893c8a247 100644
--- a/drivers/nvmem/qfprom.c
+++ b/drivers/nvmem/qfprom.c
@@ -217,9 +217,8 @@ static int qfprom_enable_fuse_blowing(const struct qfprom_priv *priv,
goto err_clk_rate_set;
}

- ret = pm_runtime_get_sync(priv->dev);
+ ret = pm_runtime_resume_and_get(priv->dev);
if (ret < 0) {
- pm_runtime_put_noidle(priv->dev);
dev_err(priv->dev, "Failed to enable power-domain\n");
goto err_reg_enable;
}
--
2.25.1


2022-04-29 11:34:42

by Srinivas Kandagatla

[permalink] [raw]
Subject: Re: [PATCH] nvmem: qfprom: using pm_runtime_resume_and_get instead of pm_runtime_get_sync



On 11/04/2022 02:40, [email protected] wrote:
> From: Minghao Chi <[email protected]>
>
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: Minghao Chi <[email protected]>

Applied thanks,

--srini
> ---
> drivers/nvmem/qfprom.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c
> index 162132c7dab9..c1e893c8a247 100644
> --- a/drivers/nvmem/qfprom.c
> +++ b/drivers/nvmem/qfprom.c
> @@ -217,9 +217,8 @@ static int qfprom_enable_fuse_blowing(const struct qfprom_priv *priv,
> goto err_clk_rate_set;
> }
>
> - ret = pm_runtime_get_sync(priv->dev);
> + ret = pm_runtime_resume_and_get(priv->dev);
> if (ret < 0) {
> - pm_runtime_put_noidle(priv->dev);
> dev_err(priv->dev, "Failed to enable power-domain\n");
> goto err_reg_enable;
> }