summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mediatek
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2017-03-07 16:27:10 +0100
committerDavid S. Miller <davem@davemloft.net>2017-03-09 22:16:34 +0100
commite3c36e483b4806a6bf28db411f79ea9aad61ec78 (patch)
treeed6f4adaf04fd76c4f5eca4daed709053938f1a7 /drivers/net/ethernet/mediatek
parenttg3: Add the ability to conditionally build w/ HWMON (diff)
downloadlinux-e3c36e483b4806a6bf28db411f79ea9aad61ec78.tar.xz
linux-e3c36e483b4806a6bf28db411f79ea9aad61ec78.zip
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>
Diffstat (limited to 'drivers/net/ethernet/mediatek')
-rw-r--r--drivers/net/ethernet/mediatek/mtk_eth_soc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 9e757684816d..bf6317eca2f6 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -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);