net: mediatek: Use eth_hw_addr_random()
authorTobias Klauser <tklauser@distanz.ch>
Tue, 7 Mar 2017 15:27:10 +0000 (16:27 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 Mar 2017 21:16:34 +0000 (13:16 -0800)
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>
drivers/net/ethernet/mediatek/mtk_eth_soc.c

index 9e757684816d48b903f62cdac2d6a1123e6c3305..bf6317eca2f6bde8c739a50ae9722353549749df 100644 (file)
@@ -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);