From: phucduc.bui@gmail.com
To: Ulf Hansson <ulfh@kernel.org>, Frank Li <Frank.Li@nxp.com>,
Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
rafael.j.wysocki@intel.com, Jacky Bai <ping.bai@nxp.com>,
Lucas Stach <l.stach@pengutronix.de>, Peng Fan <peng.fan@nxp.com>,
Xu Yang <xu.yang_2@nxp.com>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Ming Qian <ming.qian@oss.nxp.com>,
u.kleine-koenig@baylibre.com,
Marco Felsch <m.felsch@pengutronix.de>,
Alexander Stein <alexander.stein@ew.tq-group.com>,
Guoniu Zhou <guoniu.zhou@oss.nxp.com>,
linux-pm@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 1/3] pmdomain: imx: gpcv2: Use pm_runtime_resume_and_get()
Date: Mon, 21 Sep 2026 10:37:06 +0700 [thread overview]
Message-ID: <20260921033708.14433-2-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260921033708.14433-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
Replace the open-coded pm_runtime_get_sync() + pm_runtime_put_noidle()
error handling pattern with pm_runtime_resume_and_get(), which already
does this internally.
No functional change.
Found by manual code inspection.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/pmdomain/imx/gpcv2.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/drivers/pmdomain/imx/gpcv2.c b/drivers/pmdomain/imx/gpcv2.c
index a829f8da5be7..6a54ee734514 100644
--- a/drivers/pmdomain/imx/gpcv2.c
+++ b/drivers/pmdomain/imx/gpcv2.c
@@ -317,11 +317,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);
@@ -1397,21 +1395,13 @@ static void imx_pgc_domain_remove(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP
static int imx_pgc_domain_suspend(struct device *dev)
{
- int ret;
-
/*
* This may look strange, but is done so the generic PM_SLEEP code
* can power down our domain and more importantly power it up again
* 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);
- return ret;
- }
-
- return 0;
+ return pm_runtime_resume_and_get(dev);
}
static int imx_pgc_domain_resume(struct device *dev)
--
2.43.0
next prev parent reply other threads:[~2026-09-21 3:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 3:37 [PATCH 0/3] pmdomain: imx: " phucduc.bui
2026-09-21 3:37 ` phucduc.bui [this message]
2026-09-21 16:16 ` [PATCH 1/3] pmdomain: imx: gpcv2: " Frank Li
2026-09-21 3:37 ` [PATCH 2/3] pmdomain: imx8m-blk-ctrl: " phucduc.bui
2026-09-21 16:18 ` Frank Li
2026-09-21 3:37 ` [PATCH 3/3] pmdomain: imx93-blk-ctrl: " phucduc.bui
2026-09-21 16:18 ` Frank Li
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=20260921033708.14433-2-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=Frank.Li@nxp.com \
--cc=alexander.stein@ew.tq-group.com \
--cc=benjamin.gaignard@collabora.com \
--cc=festevam@gmail.com \
--cc=guoniu.zhou@oss.nxp.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=m.felsch@pengutronix.de \
--cc=ming.qian@oss.nxp.com \
--cc=peng.fan@nxp.com \
--cc=ping.bai@nxp.com \
--cc=rafael.j.wysocki@intel.com \
--cc=s.hauer@pengutronix.de \
--cc=u.kleine-koenig@baylibre.com \
--cc=ulfh@kernel.org \
--cc=xu.yang_2@nxp.com \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®