From: Russell King (Oracle) Date: Fri, 14 Nov 2025 15:28:34 +0000 (+0000) Subject: net: stmmac: move initialisation of clk_csr to stmmac_plat_dat_alloc() X-Git-Tag: v6.19-rc1~170^2~147^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae4f29712bf3468111b9ca65b6ecd94c062cb98f;p=thirdparty%2Fkernel%2Flinux.git net: stmmac: move initialisation of clk_csr to stmmac_plat_dat_alloc() Move the default initialisation of plat_dat->clk_csr to stmmac_plat_dat_alloc(). Signed-off-by: Russell King (Oracle) Link: https://patch.msgid.link/E1vJvj0-0000000EVjb-1jDh@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 1851f7d0702dc..a36e8a90fcaad 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -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; } diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 745032fd46ce7..fe3d95274fd6b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -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);