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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---
 drivers/phy/ti/phy-dm816x-usb.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

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 = {
-- 
2.39.0





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux