]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: move initialisation of clk_csr to stmmac_plat_dat_alloc()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 14 Nov 2025 15:28:34 +0000 (15:28 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 18 Nov 2025 03:47:57 +0000 (19:47 -0800)
Move the default initialisation of plat_dat->clk_csr to
stmmac_plat_dat_alloc().

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vJvj0-0000000EVjb-1jDh@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

index 1851f7d0702dc377b75a6c892656253225a16687..a36e8a90fcaad2fb2ce84e8cb5aad017c4789f37 100644 (file)
@@ -7565,8 +7565,10 @@ struct plat_stmmacenet_data *stmmac_plat_dat_alloc(struct device *dev)
 
        /* Set the defaults:
         * - phy autodetection
+        * - determine GMII_Address CR field from CSR clock
         */
        plat_dat->phy_addr = -1;
+       plat_dat->clk_csr = -1;
 
        return plat_dat;
 }
index 745032fd46ce77880e901af737a7a76deb47bede..fe3d95274fd6b918c2aeed35cc8eebe0d20b508f 100644 (file)
@@ -480,11 +480,6 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
                plat->bus_id = ++bus_id;
        }
 
-
-       /* Default to get clk_csr from stmmac_clk_csr_set(),
-        * or get clk_csr from device tree.
-        */
-       plat->clk_csr = -1;
        if (of_property_read_u32(np, "snps,clk-csr", &plat->clk_csr))
                of_property_read_u32(np, "clk_csr", &plat->clk_csr);