From: cgel.zte@gmail.com To: shawnguo@kernel.org Cc: s.hauer@pengutronix.de, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Minghao Chi <chi.minghao@zte.com.cn>, Zeal Robot <zealci@zte.com.cn> Subject: [PATCH] soc: imx: gpcv2: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Date: Mon, 18 Apr 2022 06:30:26 +0000 [thread overview] Message-ID: <20220418063026.2558012-1-chi.minghao@zte.com.cn> (raw) From: Minghao Chi <chi.minghao@zte.com.cn> Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> --- drivers/soc/imx/gpcv2.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 3cb123016b3e..4f445889a9e8 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -224,11 +224,9 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) u32 reg_val, pgc; int ret; - ret = pm_runtime_get_sync(domain->dev); - if (ret < 0) { - pm_runtime_put_noidle(domain->dev); + ret = pm_runtime_resume_and_get(domain->dev); + if (ret < 0) return ret; - } if (!IS_ERR(domain->regulator)) { ret = regulator_enable(domain->regulator); @@ -987,11 +985,9 @@ static int imx_pgc_domain_suspend(struct device *dev) * after resume, without tripping over our usage of runtime PM to * power up/down the nested domains. */ - ret = pm_runtime_get_sync(dev); - if (ret < 0) { - pm_runtime_put_noidle(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) return ret; - } return 0; } -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: cgel.zte@gmail.com To: shawnguo@kernel.org Cc: s.hauer@pengutronix.de, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Minghao Chi <chi.minghao@zte.com.cn>, Zeal Robot <zealci@zte.com.cn> Subject: [PATCH] soc: imx: gpcv2: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Date: Mon, 18 Apr 2022 06:30:26 +0000 [thread overview] Message-ID: <20220418063026.2558012-1-chi.minghao@zte.com.cn> (raw) From: Minghao Chi <chi.minghao@zte.com.cn> Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> --- drivers/soc/imx/gpcv2.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 3cb123016b3e..4f445889a9e8 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -224,11 +224,9 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) u32 reg_val, pgc; int ret; - ret = pm_runtime_get_sync(domain->dev); - if (ret < 0) { - pm_runtime_put_noidle(domain->dev); + ret = pm_runtime_resume_and_get(domain->dev); + if (ret < 0) return ret; - } if (!IS_ERR(domain->regulator)) { ret = regulator_enable(domain->regulator); @@ -987,11 +985,9 @@ static int imx_pgc_domain_suspend(struct device *dev) * after resume, without tripping over our usage of runtime PM to * power up/down the nested domains. */ - ret = pm_runtime_get_sync(dev); - if (ret < 0) { - pm_runtime_put_noidle(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) return ret; - } return 0; } -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2022-04-18 6:30 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-18 6:30 cgel.zte [this message] 2022-04-18 6:30 ` [PATCH] soc: imx: gpcv2: using pm_runtime_resume_and_get instead of pm_runtime_get_sync cgel.zte
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220418063026.2558012-1-chi.minghao@zte.com.cn \ --to=cgel.zte@gmail.com \ --cc=chi.minghao@zte.com.cn \ --cc=kernel@pengutronix.de \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=s.hauer@pengutronix.de \ --cc=shawnguo@kernel.org \ --cc=zealci@zte.com.cn \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.