]> www.infradead.org Git - users/hch/misc.git/commitdiff
Revert "net: ethernet: stmmac: dwmac-rk: Make the clk_phy could be used for external...
authorChaoyi Chen <chaoyi.chen@rock-chips.com>
Tue, 16 Sep 2025 01:26:28 +0000 (09:26 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 17 Sep 2025 22:16:36 +0000 (15:16 -0700)
This reverts commit da114122b83149d1f1db0586b1d67947b651aa20.

As discussed, the PHY clock should be managed by PHY driver instead
of other driver like dwmac-rk.

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/a30a8c97-6b96-45ba-bad7-8a40401babc2@samsung.com
Fixes: da114122b831 ("net: ethernet: stmmac: dwmac-rk: Make the clk_phy could be used for external phy")
Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Link: https://patch.msgid.link/0A3F1D1604FEE424+20250916012628.1819-1-kernel@airkyi.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c

index 266c5337923659dd9b5e5c7cd5b460d8deac3b8f..49f92cd79aa8728e9749c11eee785b4ab1ea2720 100644 (file)
@@ -1410,15 +1410,12 @@ static int rk_gmac_clk_init(struct plat_stmmacenet_data *plat)
                clk_set_rate(plat->stmmac_clk, 50000000);
        }
 
-       if (plat->phy_node) {
+       if (plat->phy_node && bsp_priv->integrated_phy) {
                bsp_priv->clk_phy = of_clk_get(plat->phy_node, 0);
                ret = PTR_ERR_OR_ZERO(bsp_priv->clk_phy);
-               /* If it is not integrated_phy, clk_phy is optional */
-               if (bsp_priv->integrated_phy) {
-                       if (ret)
-                               return dev_err_probe(dev, ret, "Cannot get PHY clock\n");
-                       clk_set_rate(bsp_priv->clk_phy, 50000000);
-               }
+               if (ret)
+                       return dev_err_probe(dev, ret, "Cannot get PHY clock\n");
+               clk_set_rate(bsp_priv->clk_phy, 50000000);
        }
 
        return 0;