aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qualcomm/emac/emac.c
diff options
context:
space:
mode:
authorTimur Tabi <timur@codeaurora.org>2016-09-28 11:58:43 -0500
committerDavid S. Miller <davem@davemloft.net>2016-09-29 01:50:13 -0400
commit0de709acbc0d0001dc4b0953aebcfb0f030b9b0e (patch)
tree87a7a7aa660cd9bfc96c9812e562dbef1fd7275f /drivers/net/ethernet/qualcomm/emac/emac.c
parentnet: qcom/emac: do not use devm on internal phy pdev (diff)
downloadlinux-dev-0de709acbc0d0001dc4b0953aebcfb0f030b9b0e.tar.xz
linux-dev-0de709acbc0d0001dc4b0953aebcfb0f030b9b0e.zip
net: qcom/emac: use device_get_mac_address
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 <timur@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qualcomm/emac/emac.c')
-rw-r--r--drivers/net/ethernet/qualcomm/emac/emac.c10
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)
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);