Skip to content

Commit

Permalink
net: qcom/emac: use device_get_mac_address
Browse files Browse the repository at this point in the history
Replace the DT-specific of_get_mac_address() function with
device_get_mac_address, which works on both DT and ACPI platforms.  This
change makes it easier to add ACPI support.

Signed-off-by: Timur Tabi <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Timur Tabi authored and davem330 committed Sep 29, 2016
1 parent 54e19bc commit 0de709a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/net/ethernet/qualcomm/emac/emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,18 +531,16 @@ static void emac_clks_teardown(struct emac_adapter *adpt)
static int emac_probe_resources(struct platform_device *pdev,
struct emac_adapter *adpt)
{
struct device_node *node = pdev->dev.of_node;
struct net_device *netdev = adpt->netdev;
struct resource *res;
const void *maddr;
char maddr[ETH_ALEN];
int ret = 0;

/* get mac address */
maddr = of_get_mac_address(node);
if (!maddr)
eth_hw_addr_random(netdev);
else
if (device_get_mac_address(&pdev->dev, maddr, ETH_ALEN))
ether_addr_copy(netdev->dev_addr, maddr);
else
eth_hw_addr_random(netdev);

/* Core 0 interrupt */
ret = platform_get_irq(pdev, 0);
Expand Down

0 comments on commit 0de709a

Please sign in to comment.