diff mbox series

soc: ti: smartreflex: change to use devm_clk_get_prepared() helpers

Message ID 20240822095911.1644729-1-bo.wu@vivo.com
State New
Headers show
Series soc: ti: smartreflex: change to use devm_clk_get_prepared() helpers | expand

Commit Message

Wu Bo Aug. 22, 2024, 9:59 a.m. UTC
Make the code cleaner and avoid call clk_unprepare()

Signed-off-by: Wu Bo <bo.wu@vivo.com>
---
 drivers/soc/ti/smartreflex.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/soc/ti/smartreflex.c b/drivers/soc/ti/smartreflex.c
index d6219060b616..103ea0ae7661 100644
--- a/drivers/soc/ti/smartreflex.c
+++ b/drivers/soc/ti/smartreflex.c
@@ -844,10 +844,9 @@  static int omap_sr_probe(struct platform_device *pdev)
 	if (ret > 0)
 		sr_info->irq = ret;
 
-	sr_info->fck = devm_clk_get(pdev->dev.parent, "fck");
+	sr_info->fck = devm_clk_get_prepared(pdev->dev.parent, "fck");
 	if (IS_ERR(sr_info->fck))
 		return PTR_ERR(sr_info->fck);
-	clk_prepare(sr_info->fck);
 
 	pm_runtime_enable(&pdev->dev);
 
@@ -928,7 +927,6 @@  static int omap_sr_probe(struct platform_device *pdev)
 err_list_del:
 	pm_runtime_disable(&pdev->dev);
 	list_del(&sr_info->node);
-	clk_unprepare(sr_info->fck);
 
 	return ret;
 }
@@ -943,7 +941,6 @@  static void omap_sr_remove(struct platform_device *pdev)
 	debugfs_remove_recursive(sr_info->dbg_dir);
 
 	pm_runtime_disable(dev);
-	clk_unprepare(sr_info->fck);
 	list_del(&sr_info->node);
 }