[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220413093730.2538566-1-chi.minghao@zte.com.cn>
Date: Wed, 13 Apr 2022 09:37:30 +0000
From: cgel.zte@...il.com
To: shawnguo@...nel.org
Cc: s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
linux-imx@....com, l.stach@...gutronix.de,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Minghao Chi <chi.minghao@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] soc: img: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
From: Minghao Chi <chi.minghao@....com.cn>
Using pm_runtime_resume_and_get is more appropriate
for simplifing code
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
---
drivers/soc/imx/imx8m-blk-ctrl.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-ctrl.c
index 122f9c884b38..f85517767829 100644
--- a/drivers/soc/imx/imx8m-blk-ctrl.c
+++ b/drivers/soc/imx/imx8m-blk-ctrl.c
@@ -81,9 +81,8 @@ static int imx8m_blk_ctrl_power_on(struct generic_pm_domain *genpd)
int ret;
/* make sure bus domain is awake */
- ret = pm_runtime_get_sync(bc->bus_power_dev);
+ ret = pm_runtime_resume_and_get(bc->bus_power_dev);
if (ret < 0) {
- pm_runtime_put_noidle(bc->bus_power_dev);
dev_err(bc->dev, "failed to power up bus domain\n");
return ret;
}
@@ -335,20 +334,16 @@ static int imx8m_blk_ctrl_suspend(struct device *dev)
* in the system suspend/resume paths due to the device parent/child
* hierarchy.
*/
- ret = pm_runtime_get_sync(bc->bus_power_dev);
- if (ret < 0) {
- pm_runtime_put_noidle(bc->bus_power_dev);
+ ret = pm_runtime_resume_and_get(bc->bus_power_dev);
+ if (ret < 0)
return ret;
- }
for (i = 0; i < bc->onecell_data.num_domains; i++) {
struct imx8m_blk_ctrl_domain *domain = &bc->domains[i];
- ret = pm_runtime_get_sync(domain->power_dev);
- if (ret < 0) {
- pm_runtime_put_noidle(domain->power_dev);
+ ret = pm_runtime_resume_and_get(domain->power_dev);
+ if (ret < 0)
goto out_fail;
- }
}
return 0;
--
2.25.1
Powered by blists - more mailing lists