diff mbox series

[1/4] phy: ti: phy-dm816x-usb: Convert to devm_clk_get_prepared()

Message ID 20240822084342.1595239-1-frank.li@vivo.com (mailing list archive)
State New
Headers show
Series phy: convert to devm_clk_get_*() | expand

Commit Message

Yangtao Li Aug. 22, 2024, 8:43 a.m. UTC
Convert devm_clk_get(), clk_prepare() to a single
call to devm_clk_get_prepared(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/phy/ti/phy-dm816x-usb.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/phy/ti/phy-dm816x-usb.c b/drivers/phy/ti/phy-dm816x-usb.c
index d5ae972a31fb..d47674ec5e96 100644
--- a/drivers/phy/ti/phy-dm816x-usb.c
+++ b/drivers/phy/ti/phy-dm816x-usb.c
@@ -215,12 +215,9 @@  static int dm816x_usb_phy_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, phy);
 
-	phy->refclk = devm_clk_get(phy->dev, "refclk");
+	phy->refclk = devm_clk_get_prepared(phy->dev, "refclk");
 	if (IS_ERR(phy->refclk))
 		return PTR_ERR(phy->refclk);
-	error = clk_prepare(phy->refclk);
-	if (error)
-		return error;
 
 	pm_runtime_enable(phy->dev);
 	generic_phy = devm_phy_create(phy->dev, NULL, &ops);
@@ -244,7 +241,6 @@  static int dm816x_usb_phy_probe(struct platform_device *pdev)
 
 clk_unprepare:
 	pm_runtime_disable(phy->dev);
-	clk_unprepare(phy->refclk);
 	return error;
 }
 
@@ -254,7 +250,6 @@  static void dm816x_usb_phy_remove(struct platform_device *pdev)
 
 	usb_remove_phy(&phy->phy);
 	pm_runtime_disable(phy->dev);
-	clk_unprepare(phy->refclk);
 }
 
 static struct platform_driver dm816x_usb_phy_driver = {