Skip to contentSkip to conversation

clk: starfive: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage

PATCH Applied Yuntao Liu 3 participants 3 messages Aug 15, 2024 – Aug 28, 2024

Subsystems (2)
lore
Share & tools
lore

Yuntao Liu

author
#0 lore raw

PATCH 1/1 clk: starfive: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage

We need to call pm_runtime_put_noidle() when pm_runtime_get_sync() fails, so use pm_runtime_resume_and_get() instead. this function will handle this.

Fixes dae5448a327ed ("clk: starfive: Add StarFive JH7110 Video-Output clock driver")
---
 drivers/clk/starfive/clk-starfive-jh7110-vout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/starfive/clk-starfive-jh7110-vout.c +1 -1
index 53f7af234cc2..aabd0484ac23 100644
@@ -145,7 +145,7 @@ static int jh7110_voutcrg_probe(struct platform_device *pdev)
 
 	/* enable power domain and clocks */
 	pm_runtime_enable(priv->dev);
-	ret = pm_runtime_get_sync(priv->dev);
+	ret = pm_runtime_resume_and_get(priv->dev);
 	if (ret < 0)
 		return dev_err_probe(priv->dev, ret, "failed to turn on power\n");
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Yuntao Liu

We need to call pm_runtime_put_noidle() when pm_runtime_get_sync() fails, so use pm_runtime_resume_and_get() instead. this function will handle this.

Fixes dae5448a327ed ("clk: starfive: Add StarFive JH7110 Video-Output clock

driver")

---
 drivers/clk/starfive/clk-starfive-jh7110-vout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/starfive/clk-starfive-jh7110-vout.c +1 -1
index 53f7af234cc2..aabd0484ac23 100644
@@ -145,7 +145,7 @@ static int jh7110_voutcrg_probe(struct platform_device
 *pdev)
 
 	/* enable power domain and clocks */
 	pm_runtime_enable(priv->dev);
-	ret = pm_runtime_get_sync(priv->dev);
+	ret = pm_runtime_resume_and_get(priv->dev);
 	if (ret < 0)
 		return dev_err_probe(priv->dev, ret, "failed to turn on
Quoted 2 lines

power\n");

It looks good. Thanks for your patch.

Best regards,
Xingyu Wu

maintainer Applied
#2 lore raw
In reply to Yuntao Liu

Quoting Yuntao Liu (2024-08-15 02:38:53)

Quoted 7 lines

We need to call pm_runtime_put_noidle() when pm_runtime_get_sync() fails, so use pm_runtime_resume_and_get() instead. this function will handle this.

Fixes dae5448a327ed ("clk: starfive: Add StarFive JH7110 Video-Output clock driver")

---

Applied to clk-next