diff options
| author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2025-11-11 14:26:44 +0300 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2025-11-13 19:03:19 +0300 |
| commit | f694d215d34035cc64b1d176fd82db0d1f2428d4 (patch) | |
| tree | 13cf8f6d22127b2cecec308edc887bb9f775307a /include/linux | |
| parent | d0af55df5a786cb8f11ca1923cd7dc8b2af01309 (diff) | |
| download | linux-f694d215d34035cc64b1d176fd82db0d1f2428d4.tar.xz | |
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>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/stmmac.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 48e9f1d4e17e..4f70a6551e68 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -192,6 +192,8 @@ enum dwmac_core_type { #define STMMAC_FLAG_EN_TX_LPI_CLK_PHY_CAP BIT(12) #define STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY BIT(13) +struct mac_device_info; + struct plat_stmmacenet_data { enum dwmac_core_type core_type; int bus_id; @@ -266,7 +268,7 @@ struct plat_stmmacenet_data { void (*exit)(struct platform_device *pdev, void *priv); int (*suspend)(struct device *dev, void *priv); int (*resume)(struct device *dev, void *priv); - struct mac_device_info *(*setup)(void *priv); + int (*mac_setup)(void *priv, struct mac_device_info *mac); int (*clks_config)(void *priv, bool enabled); int (*crosststamp)(ktime_t *device, struct system_counterval_t *system, void *ctx); |
