]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: always allocate mac_device_info
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 11 Nov 2025 11:26:44 +0000 (11:26 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 13 Nov 2025 16:03:19 +0000 (17:03 +0100)
commitf694d215d34035cc64b1d176fd82db0d1f2428d4
tree13cf8f6d22127b2cecec308edc887bb9f775307a
parentd0af55df5a786cb8f11ca1923cd7dc8b2af01309
net: stmmac: always allocate mac_device_info

The ->setup() method implemented by dwmac-loongson and dwmac-sun8i
allocate the mac_device_info structure, as does stmmac_hwif_init().
This makes no sense.

Have stmmac_hwif_init() always allocate this structure, and pass it to
the ->setup() method to initialise when it is provided. Rename this
method to "mac_setup" to more accurately describe what it is doing.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vImWK-0000000DrIx-28vO@rmk-PC.armlinux.org.uk
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
drivers/net/ethernet/stmicro/stmmac/hwif.c
include/linux/stmmac.h