mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-04 01:24:12 +08:00
net: mediatek: Use eth_hw_addr_random()
Use eth_hw_addr_random() to set a random dev_addr and update addr_assign_type instead of open-coding it. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
038e893d78
commit
e3c36e483b
@ -1908,10 +1908,9 @@ static int __init mtk_init(struct net_device *dev)
|
||||
|
||||
/* If the mac address is invalid, use random mac address */
|
||||
if (!is_valid_ether_addr(dev->dev_addr)) {
|
||||
random_ether_addr(dev->dev_addr);
|
||||
eth_hw_addr_random(dev);
|
||||
dev_err(eth->dev, "generated random MAC address %pM\n",
|
||||
dev->dev_addr);
|
||||
dev->addr_assign_type = NET_ADDR_RANDOM;
|
||||
}
|
||||
|
||||
return mtk_phy_connect(dev);
|
||||
|
Loading…
Reference in New Issue
Block a user