]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: remove stmmac_dwmac4_get_mac_addr()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Sat, 7 Mar 2026 10:55:08 +0000 (10:55 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 10 Mar 2026 02:44:11 +0000 (19:44 -0700)
stmmac_dwmac4_get_mac_addr() is identical to stmmac_get_mac_addr().
Remove stmmac_dwmac4_get_mac_addr() to avoid this code duplication.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vypJM-0000000CSiJ-48yO@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c

index 602771e19d0fce4c3cf6e57fa1091b2febc59ac7..e6bcb77b22a2a162e036ec639b399f8553d06e75 100644 (file)
@@ -373,8 +373,8 @@ static void dwmac4_get_umac_addr(struct mac_device_info *hw,
 {
        void __iomem *ioaddr = hw->pcsr;
 
-       stmmac_dwmac4_get_mac_addr(ioaddr, addr, GMAC_ADDR_HIGH(reg_n),
-                                  GMAC_ADDR_LOW(reg_n));
+       stmmac_get_mac_addr(ioaddr, addr, GMAC_ADDR_HIGH(reg_n),
+                           GMAC_ADDR_LOW(reg_n));
 }
 
 static int dwmac4_set_lpi_mode(struct mac_device_info *hw,
index 8c87a20880c449eb0d12983b1ba7b2d629d5f93d..a0249715fafafdf8c93d1535a15b73daed1168cb 100644 (file)
@@ -226,21 +226,3 @@ void stmmac_dwmac4_set_mac(void __iomem *ioaddr, bool enable)
        if (value != old_val)
                writel(value, ioaddr + GMAC_CONFIG);
 }
-
-void stmmac_dwmac4_get_mac_addr(void __iomem *ioaddr, unsigned char *addr,
-                               unsigned int high, unsigned int low)
-{
-       unsigned int hi_addr, lo_addr;
-
-       /* Read the MAC address from the hardware */
-       hi_addr = readl(ioaddr + high);
-       lo_addr = readl(ioaddr + low);
-
-       /* Extract the MAC address from the high and low words */
-       addr[0] = lo_addr & 0xff;
-       addr[1] = (lo_addr >> 8) & 0xff;
-       addr[2] = (lo_addr >> 16) & 0xff;
-       addr[3] = (lo_addr >> 24) & 0xff;
-       addr[4] = hi_addr & 0xff;
-       addr[5] = (hi_addr >> 8) & 0xff;
-}