arc_emac: drop redundant mac address check
authorLuka Perkov <luka@openwrt.org>
Tue, 29 Oct 2013 23:11:00 +0000 (00:11 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Oct 2013 02:52:45 +0000 (22:52 -0400)
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>
drivers/net/ethernet/arc/emac_main.c

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