aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/arc/emac_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/arc/emac_main.c')
-rw-r--r--drivers/net/ethernet/arc/emac_main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c
index d0878526c0c8..b2ffad1304d2 100644
--- a/drivers/net/ethernet/arc/emac_main.c
+++ b/drivers/net/ethernet/arc/emac_main.c
@@ -671,6 +671,7 @@ static int arc_emac_probe(struct platform_device *pdev)
671 if (!ndev) 671 if (!ndev)
672 return -ENOMEM; 672 return -ENOMEM;
673 673
674 platform_set_drvdata(pdev, ndev);
674 SET_NETDEV_DEV(ndev, &pdev->dev); 675 SET_NETDEV_DEV(ndev, &pdev->dev);
675 676
676 ndev->netdev_ops = &arc_emac_netdev_ops; 677 ndev->netdev_ops = &arc_emac_netdev_ops;
@@ -725,10 +726,10 @@ static int arc_emac_probe(struct platform_device *pdev)
725 /* Get MAC address from device tree */ 726 /* Get MAC address from device tree */
726 mac_addr = of_get_mac_address(pdev->dev.of_node); 727 mac_addr = of_get_mac_address(pdev->dev.of_node);
727 728
728 if (!mac_addr || !is_valid_ether_addr(mac_addr)) 729 if (mac_addr)
729 eth_hw_addr_random(ndev);
730 else
731 memcpy(ndev->dev_addr, mac_addr, ETH_ALEN); 730 memcpy(ndev->dev_addr, mac_addr, ETH_ALEN);
731 else
732 eth_hw_addr_random(ndev);
732 733
733 dev_info(&pdev->dev, "MAC address is now %pM\n", ndev->dev_addr); 734 dev_info(&pdev->dev, "MAC address is now %pM\n", ndev->dev_addr);
734 735