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 <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21391 Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
This commit is contained in:
parent
985f30d576
commit
28c7524e78
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user