Skip to content

Commit

Permalink
staging: mt7621-eth: Use eth_hw_addr_random()
Browse files Browse the repository at this point in the history
Use eth_hw_addr_random() to set a random dev_addr and update
addr_assign_type.

Fixes: e3cbf47 ('staging: mt7621-eth: add the drivers core files')
Signed-off-by: Kamal Heib <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Kamalheib authored and gregkh committed Jun 28, 2018
1 parent 85e1d42 commit 144e264
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/mt7621-eth/mtk_eth_soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,10 +1822,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;
}
mac->hw->soc->set_mac(mac, dev->dev_addr);

Expand Down

0 comments on commit 144e264

Please sign in to comment.