Skip to contentSkip to conversation

net: stmmac: remove stmmac_dwmac4_get_mac_addr()

PATCH Applied Russell King (Oracle) 2 participants 2 messages Mar 7 – Mar 10

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: stmmac: remove stmmac_dwmac4_get_mac_addr()

stmmac_dwmac4_get_mac_addr() is identical to stmmac_get_mac_addr(). Remove stmmac_dwmac4_get_mac_addr() to avoid this code duplication.

---
 .../net/ethernet/stmicro/stmmac/dwmac4_core.c  |  4 ++--
 .../net/ethernet/stmicro/stmmac/dwmac4_lib.c   | 18 ------------------
 2 files changed, 2 insertions(+), 20 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +2 -2
index 602771e19d0f..e6bcb77b22a2 100644
@@ -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,
drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c +0 -18
index 8c87a20880c4..a0249715fafa 100644
@@ -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;
-}
Signature · 1 line
2.47.3
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Sat, 07 Mar 2026 10:55:08 +0000 you wrote:

stmmac_dwmac4_get_mac_addr() is identical to stmmac_get_mac_addr(). Remove stmmac_dwmac4_get_mac_addr() to avoid this code duplication.

---
 .../net/ethernet/stmicro/stmmac/dwmac4_core.c  |  4 ++--
 .../net/ethernet/stmicro/stmmac/dwmac4_lib.c   | 18 ------------------
 2 files changed, 2 insertions(+), 20 deletions(-)

Here is the summary with links:
- [net-next] net: stmmac: remove stmmac_dwmac4_get_mac_addr()

    https://git.kernel.org/netdev/net-next/c/c127d4087930

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html