* [PATCH] soc: img: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
@ 2022-04-13 9:37 ` cgel.zte
0 siblings, 0 replies; 2+ messages in thread
From: cgel.zte @ 2022-04-13 9:37 UTC (permalink / raw)
To: shawnguo
Cc: s.hauer, kernel, festevam, linux-imx, l.stach, linux-arm-kernel,
linux-kernel, Minghao Chi, Zeal Robot
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/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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] soc: img: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
@ 2022-04-13 9:37 ` cgel.zte
0 siblings, 0 replies; 2+ messages in thread
From: cgel.zte @ 2022-04-13 9:37 UTC (permalink / raw)
To: shawnguo
Cc: s.hauer, kernel, festevam, linux-imx, l.stach, linux-arm-kernel,
linux-kernel, Minghao Chi, Zeal Robot
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/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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-13 9:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13 9:37 [PATCH] soc: img: using pm_runtime_resume_and_get instead of pm_runtime_get_sync cgel.zte
2022-04-13 9:37 ` cgel.zte
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.