[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240822084417.1596110-1-frank.li@vivo.com>
Date: Thu, 22 Aug 2024 02:44:16 -0600
From: Yangtao Li <frank.li@...o.com>
To: vkoul@...nel.org,
kishon@...nel.org,
krzk@...nel.org,
alim.akhtar@...sung.com,
frank.li@...o.com,
konrad.dybcio@...aro.org,
liubo03@...pur.com,
robh@...nel.org,
yuvaraj.cd@...il.com,
ks.giri@...sung.com,
vasanth.a@...sung.com
Cc: linux-arm-msm@...r.kernel.org,
linux-phy@...ts.infradead.org,
linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org
Subject: [PATCH 3/4] phy: qualcomm: phy-qcom-ipq806x-sata: Convert to devm_clk_get_enabled()
Convert devm_clk_get(), clk_prepare_enable() to a single
call to devm_clk_get_enabled(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@...o.com>
---
drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c | 22 ++++----------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c b/drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c
index f0a72b82c770..bf2d91c00700 100644
--- a/drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c
+++ b/drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c
@@ -17,7 +17,6 @@
struct qcom_ipq806x_sata_phy {
void __iomem *mmio;
- struct clk *cfg_clk;
struct device *dev;
};
@@ -130,7 +129,7 @@ static int qcom_ipq806x_sata_phy_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct phy_provider *phy_provider;
struct phy *generic_phy;
- int ret;
+ struct clk *cfg_clk;
phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
if (!phy)
@@ -150,19 +149,14 @@ static int qcom_ipq806x_sata_phy_probe(struct platform_device *pdev)
phy_set_drvdata(generic_phy, phy);
platform_set_drvdata(pdev, phy);
- phy->cfg_clk = devm_clk_get(dev, "cfg");
- if (IS_ERR(phy->cfg_clk)) {
+ cfg_clk = devm_clk_get_enabled(dev, "cfg");
+ if (IS_ERR(cfg_clk)) {
dev_err(dev, "Failed to get sata cfg clock\n");
- return PTR_ERR(phy->cfg_clk);
+ return PTR_ERR(cfg_clk);
}
- ret = clk_prepare_enable(phy->cfg_clk);
- if (ret)
- return ret;
-
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
if (IS_ERR(phy_provider)) {
- clk_disable_unprepare(phy->cfg_clk);
dev_err(dev, "%s: failed to register phy\n", __func__);
return PTR_ERR(phy_provider);
}
@@ -170,13 +164,6 @@ static int qcom_ipq806x_sata_phy_probe(struct platform_device *pdev)
return 0;
}
-static void qcom_ipq806x_sata_phy_remove(struct platform_device *pdev)
-{
- struct qcom_ipq806x_sata_phy *phy = platform_get_drvdata(pdev);
-
- clk_disable_unprepare(phy->cfg_clk);
-}
-
static const struct of_device_id qcom_ipq806x_sata_phy_of_match[] = {
{ .compatible = "qcom,ipq806x-sata-phy" },
{ },
@@ -185,7 +172,6 @@ MODULE_DEVICE_TABLE(of, qcom_ipq806x_sata_phy_of_match);
static struct platform_driver qcom_ipq806x_sata_phy_driver = {
.probe = qcom_ipq806x_sata_phy_probe,
- .remove_new = qcom_ipq806x_sata_phy_remove,
.driver = {
.name = "qcom-ipq806x-sata-phy",
.of_match_table = qcom_ipq806x_sata_phy_of_match,
--
2.39.0
Powered by blists - more mailing lists