diff options
author | Luka Perkov <luka@openwrt.org> | 2013-10-29 19:11:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-29 22:52:45 -0400 |
commit | 99470819b1a89f77c1eb44f6b3328c1aeb2c87d0 (patch) | |
tree | 13d824fd0ba6d9bc3d76f7f4bcb144c4c1bd285c | |
parent | 6c7a9a3c7838eab1f17ef00c87925151be06cf1c (diff) |
arc_emac: drop redundant mac address check
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>
-rw-r--r-- | drivers/net/ethernet/arc/emac_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c index 9e1601487263..d818ded6c05c 100644 --- a/drivers/net/ethernet/arc/emac_main.c +++ b/drivers/net/ethernet/arc/emac_main.c | |||
@@ -725,10 +725,10 @@ static int arc_emac_probe(struct platform_device *pdev) | |||
725 | /* Get MAC address from device tree */ | 725 | /* Get MAC address from device tree */ |
726 | mac_addr = of_get_mac_address(pdev->dev.of_node); | 726 | mac_addr = of_get_mac_address(pdev->dev.of_node); |
727 | 727 | ||
728 | if (!mac_addr || !is_valid_ether_addr(mac_addr)) | 728 | if (mac_addr) |
729 | eth_hw_addr_random(ndev); | ||
730 | else | ||
731 | memcpy(ndev->dev_addr, mac_addr, ETH_ALEN); | 729 | memcpy(ndev->dev_addr, mac_addr, ETH_ALEN); |
730 | else | ||
731 | eth_hw_addr_random(ndev); | ||
732 | 732 | ||
733 | dev_info(&pdev->dev, "MAC address is now %pM\n", ndev->dev_addr); | 733 | dev_info(&pdev->dev, "MAC address is now %pM\n", ndev->dev_addr); |
734 | 734 | ||