Skip to content

Commit

Permalink
arc_emac: drop redundant mac address check
Browse files Browse the repository at this point in the history
Checking if MAC address is valid using is_valid_ether_addr() is already done in
of_get_mac_address(). While at it, reorganize checking so it matches checks in
other drivers.

Signed-off-by: Luka Perkov <luka@openwrt.org>
CC: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
CC: David Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Luka Perkov authored and David S. Miller committed Oct 30, 2013
1 parent 6c7a9a3 commit 9947081
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/arc/emac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,10 +725,10 @@ static int arc_emac_probe(struct platform_device *pdev)
/* Get MAC address from device tree */
mac_addr = of_get_mac_address(pdev->dev.of_node);

if (!mac_addr || !is_valid_ether_addr(mac_addr))
eth_hw_addr_random(ndev);
else
if (mac_addr)
memcpy(ndev->dev_addr, mac_addr, ETH_ALEN);
else
eth_hw_addr_random(ndev);

dev_info(&pdev->dev, "MAC address is now %pM\n", ndev->dev_addr);

Expand Down

0 comments on commit 9947081

Please sign in to comment.