[PATCH 1/3] pmdomain: imx: gpcv2: Use pm_runtime_resume_and_get()
phucduc.bui at gmail.com
phucduc.bui at gmail.com
Sun Sep 20 20:37:06 PDT 2026
From: bui duc phuc <phucduc.bui at 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 at 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
More information about the linux-arm-kernel
mailing list