[PATCH] clk: starfive: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage

Yuntao Liu posted 1 patch 1 year, 5 months ago
drivers/clk/starfive/clk-starfive-jh7110-vout.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] clk: starfive: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage
Posted by Yuntao Liu 1 year, 5 months ago
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")
Signed-off-by: Yuntao Liu <liuyuntao12@huawei.com>
---
 drivers/clk/starfive/clk-starfive-jh7110-vout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/starfive/clk-starfive-jh7110-vout.c b/drivers/clk/starfive/clk-starfive-jh7110-vout.c
index 53f7af234cc2..aabd0484ac23 100644
--- a/drivers/clk/starfive/clk-starfive-jh7110-vout.c
+++ b/drivers/clk/starfive/clk-starfive-jh7110-vout.c
@@ -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");
 
-- 
2.34.1
Re: [PATCH] clk: starfive: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage
Posted by Stephen Boyd 1 year, 5 months ago
Quoting Yuntao Liu (2024-08-15 02:38:53)
> 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")
> Signed-off-by: Yuntao Liu <liuyuntao12@huawei.com>
> ---

Applied to clk-next