diff options
-rw-r--r-- | drivers/net/ethernet/qualcomm/emac/emac.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c index 429b4cb59ac4..551df1c52620 100644 --- a/drivers/net/ethernet/qualcomm/emac/emac.c +++ b/drivers/net/ethernet/qualcomm/emac/emac.c | |||
@@ -531,18 +531,16 @@ static void emac_clks_teardown(struct emac_adapter *adpt) | |||
531 | static int emac_probe_resources(struct platform_device *pdev, | 531 | static int emac_probe_resources(struct platform_device *pdev, |
532 | struct emac_adapter *adpt) | 532 | struct emac_adapter *adpt) |
533 | { | 533 | { |
534 | struct device_node *node = pdev->dev.of_node; | ||
535 | struct net_device *netdev = adpt->netdev; | 534 | struct net_device *netdev = adpt->netdev; |
536 | struct resource *res; | 535 | struct resource *res; |
537 | const void *maddr; | 536 | char maddr[ETH_ALEN]; |
538 | int ret = 0; | 537 | int ret = 0; |
539 | 538 | ||
540 | /* get mac address */ | 539 | /* get mac address */ |
541 | maddr = of_get_mac_address(node); | 540 | if (device_get_mac_address(&pdev->dev, maddr, ETH_ALEN)) |
542 | if (!maddr) | ||
543 | eth_hw_addr_random(netdev); | ||
544 | else | ||
545 | ether_addr_copy(netdev->dev_addr, maddr); | 541 | ether_addr_copy(netdev->dev_addr, maddr); |
542 | else | ||
543 | eth_hw_addr_random(netdev); | ||
546 | 544 | ||
547 | /* Core 0 interrupt */ | 545 | /* Core 0 interrupt */ |
548 | ret = platform_get_irq(pdev, 0); | 546 | ret = platform_get_irq(pdev, 0); |