[PATCH RFC net-next 03/15] net: stmmac: rk: add SoC specific ->init() method

Russell King (Oracle)
2025-12-01T14:51:11Z

Add a SoC specific init method.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index f9bc9b145ff4..e9f531d6c22a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -35,6 +35,7 @@ struct rk_reg_speed_data {
};

struct rk_gmac_ops {
+ int (*init)(struct rk_priv_data *bsp_priv);
void (*set_to_rgmii)(struct rk_priv_data *bsp_priv,
int tx_delay, int rx_delay);
void (*set_to_rmii)(struct rk_priv_data *bsp_priv);
@@ -1613,6 +1614,14 @@ static struct rk_priv_data *rk_gmac_setup(struct platform_device *pdev,

bsp_priv->dev = dev;

+ if (ops->init) {
+ ret = ops->init(bsp_priv);
+ if (ret) {
+ dev_err_probe(dev, ret, "failed to init BSP\n");
+ return ERR_PTR(ret);
+ }
+ }
+
return bsp_priv;