]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: move initialisation of phy_addr to stmmac_plat_dat_alloc()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 14 Nov 2025 15:28:29 +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->phy_addr to
stmmac_plat_dat_alloc().

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

index 2d803fa37e212c32d7f553a98adb979395874df1..8593411844bce4c057c249cfef10e10af1baacc4 100644 (file)
@@ -114,9 +114,6 @@ static void loongson_default_data(struct pci_dev *pdev,
        plat->clk_ref_rate = 125000000;
        plat->clk_ptp_rate = 125000000;
 
-       /* Default to phy auto-detection */
-       plat->phy_addr = -1;
-
        plat->dma_cfg->pbl = 32;
        plat->dma_cfg->pblx8 = true;
 
index 400b4b9558207e5a5aed537175d29a9dd24255e5..1851f7d0702dc377b75a6c892656253225a16687 100644 (file)
@@ -7563,6 +7563,11 @@ struct plat_stmmacenet_data *stmmac_plat_dat_alloc(struct device *dev)
        if (!plat_dat)
                return NULL;
 
+       /* Set the defaults:
+        * - phy autodetection
+        */
+       plat_dat->phy_addr = -1;
+
        return plat_dat;
 }
 EXPORT_SYMBOL_GPL(stmmac_plat_dat_alloc);
index 622cdbeca20fe7b047d70ce2ffff728198c2c285..b981a9dd511df482d5c2d8b513d681190bd63a47 100644 (file)
@@ -112,7 +112,6 @@ static int snps_gmac5_default_data(struct pci_dev *pdev,
        }
 
        plat->bus_id = 1;
-       plat->phy_addr = -1;
        plat->phy_interface = PHY_INTERFACE_MODE_GMII;
 
        plat->dma_cfg->pbl = 32;
index 38d574907a044257a5680c5bf5ccc96e2f616f94..745032fd46ce77880e901af737a7a76deb47bede 100644 (file)
@@ -480,8 +480,6 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
                plat->bus_id = ++bus_id;
        }
 
-       /* Default to phy auto-detection */
-       plat->phy_addr = -1;
 
        /* Default to get clk_csr from stmmac_clk_csr_set(),
         * or get clk_csr from device tree.