From 28c7524e78e38f767d13d6eed78c594f7ab5d8f4 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 4 Jan 2026 20:31:08 +0100 Subject: realtek: eth: harmonize mac (aka chip) init The ethernet driver must initialize the chip for proper operation. Currently there exist functions for RTL838x, RTL839x and RTL931x. All of them are called differently. Combine them in a central call location. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/21391 Signed-off-by: Stijn Tintel --- .../realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c index ec3df030b9..69c6e95bd5 100644 --- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c +++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c @@ -1704,9 +1704,6 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev) dev->hw_features = NETIF_F_RXCSUM; dev->netdev_ops = priv->r->netdev_ops; - if (priv->r->family_id == RTL9310_FAMILY_ID) - rtl931x_chip_init(priv); - priv->rxringlen = rxringlen; priv->rxrings = rxrings; @@ -1723,7 +1720,12 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev) return err; } - rtl8380_init_mac(priv); + if (priv->r->family_id == RTL8380_FAMILY_ID) + rtl8380_init_mac(priv); + else if (priv->r->family_id == RTL8390_FAMILY_ID) + rtl8390_init_mac(priv); + else if (priv->r->family_id == RTL9310_FAMILY_ID) + rtl931x_chip_init(priv); /* Try to get mac address in the following order: * 1) from device tree data -- cgit v1.2.3