[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <3b3d8f60e553af09a51b501b8ff5406fa5e898dd.1749006565.git.xiaopei01@kylinos.cn>
Date: Wed, 4 Jun 2025 11:13:30 +0800
From: Pei Xiao <xiaopei01@...inos.cn>
To: nicolas.frattaroli@...labora.com,
linux-rockchip@...ts.infradead.org,
linux-sound@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Cc: Pei Xiao <xiaopei01@...inos.cn>
Subject: [PATCH 2/2] ASOC: rockchip: Use helper function devm_clk_get_enabled()
Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared
and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be
replaced by devm_clk_get_enabled() when driver enables the clocks for the
whole lifetime of the device. Moreover, it is no longer necessary to
unprepare and disable the clocks explicitly.
Signed-off-by: Pei Xiao <xiaopei01@...inos.cn>
---
sound/soc/rockchip/rockchip_sai.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/sound/soc/rockchip/rockchip_sai.c b/sound/soc/rockchip/rockchip_sai.c
index 79b04770da1c..2ec675708681 100644
--- a/sound/soc/rockchip/rockchip_sai.c
+++ b/sound/soc/rockchip/rockchip_sai.c
@@ -1448,16 +1448,12 @@ static int rockchip_sai_probe(struct platform_device *pdev)
"Failed to get mclk\n");
}
- sai->hclk = devm_clk_get(&pdev->dev, "hclk");
+ sai->hclk = devm_clk_get_enabled(&pdev->dev, "hclk");
if (IS_ERR(sai->hclk)) {
return dev_err_probe(&pdev->dev, PTR_ERR(sai->hclk),
"Failed to get hclk\n");
}
- ret = clk_prepare_enable(sai->hclk);
- if (ret)
- return dev_err_probe(&pdev->dev, ret, "Failed to enable hclk\n");
-
regmap_read(sai->regmap, SAI_VERSION, &sai->version);
ret = rockchip_sai_init_dai(sai, res, &dai);
@@ -1512,8 +1508,6 @@ static int rockchip_sai_probe(struct platform_device *pdev)
if (pm_runtime_put(&pdev->dev))
rockchip_sai_runtime_suspend(&pdev->dev);
err_disable_hclk:
- clk_disable_unprepare(sai->hclk);
-
return ret;
}
--
2.25.1
Powered by blists - more mailing lists