]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
phy: rockchip: samsung-hdptx: Drop superfluous cfgs driver data
authorCristian Ciocaltea <cristian.ciocaltea@collabora.com>
Tue, 18 Mar 2025 12:35:41 +0000 (14:35 +0200)
committerVinod Koul <vkoul@kernel.org>
Fri, 11 Apr 2025 11:48:03 +0000 (17:18 +0530)
The ->cfgs member has been introduced via commit f08d1c085638 ("phy:
phy-rockchip-samsung-hdptx: Don't use dt aliases to determine phy-id"),
but it is only used during probe() in order to setup ->phy_id.

Use a probe() local variable to store device match data and remove the
now unnecessary member from struct rk_hdptx_phy.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Link: https://lore.kernel.org/r/20250318-phy-sam-hdptx-bpc-v6-7-8cb1678e7663@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c

index c9f79c4e698cef405dd2b6a8c1071e296464c36e..2c0ae2442842fe84a86eba6815125be9d31cc41e 100644 (file)
@@ -392,10 +392,7 @@ struct rk_hdptx_phy {
        struct regmap *regmap;
        struct regmap *grf;
 
-       /* PHY const config */
-       const struct rk_hdptx_phy_cfg *cfgs;
        int phy_id;
-
        struct phy *phy;
        struct clk_bulk_data *clks;
        int nr_clks;
@@ -1894,6 +1891,7 @@ static int rk_hdptx_phy_runtime_resume(struct device *dev)
 
 static int rk_hdptx_phy_probe(struct platform_device *pdev)
 {
+       const struct rk_hdptx_phy_cfg *cfgs;
        struct phy_provider *phy_provider;
        struct device *dev = &pdev->dev;
        struct rk_hdptx_phy *hdptx;
@@ -1912,14 +1910,14 @@ static int rk_hdptx_phy_probe(struct platform_device *pdev)
                return dev_err_probe(dev, PTR_ERR(regs),
                                     "Failed to ioremap resource\n");
 
-       hdptx->cfgs = device_get_match_data(dev);
-       if (!hdptx->cfgs)
+       cfgs = device_get_match_data(dev);
+       if (!cfgs)
                return dev_err_probe(dev, -EINVAL, "missing match data\n");
 
        /* find the phy-id from the io address */
        hdptx->phy_id = -ENODEV;
-       for (id = 0; id < hdptx->cfgs->num_phys; id++) {
-               if (res->start == hdptx->cfgs->phy_ids[id]) {
+       for (id = 0; id < cfgs->num_phys; id++) {
+               if (res->start == cfgs->phy_ids[id]) {
                        hdptx->phy_id = id;
                        break;
                }