summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ethoc.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2016-12-04 23:40:29 +0300
committerDavid S. Miller <davem@davemloft.net>2016-12-05 23:30:03 +0300
commitb34296a9c047504e2020fb4ce2f66f57bd5454a8 (patch)
tree2222d5f1d6162367723975da0b8b0ff9cafe1bf9 /drivers/net/ethernet/ethoc.c
parentabf7e53e9e6bbd2aa23a6d46bd74cb5dc1b7f564 (diff)
downloadlinux-b34296a9c047504e2020fb4ce2f66f57bd5454a8.tar.xz
net: ethoc: Utilize of_get_mac_address()
Do not open code getting the MAC address exclusively from the "local-mac-address" property, but instead use of_get_mac_address() which looks up the MAC address using the 3 typical property names. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Tobias Klauser <tklauser@distanz.ch> Acked-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ethoc.c')
-rw-r--r--drivers/net/ethernet/ethoc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
index 877c02a36c85..8d0cb5ce87ee 100644
--- a/drivers/net/ethernet/ethoc.c
+++ b/drivers/net/ethernet/ethoc.c
@@ -23,6 +23,7 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/of.h>
+#include <linux/of_net.h>
#include <linux/module.h>
#include <net/ethoc.h>
@@ -1158,11 +1159,9 @@ static int ethoc_probe(struct platform_device *pdev)
memcpy(netdev->dev_addr, pdata->hwaddr, IFHWADDRLEN);
priv->phy_id = pdata->phy_id;
} else {
- const uint8_t *mac;
+ const void *mac;
- mac = of_get_property(pdev->dev.of_node,
- "local-mac-address",
- NULL);
+ mac = of_get_mac_address(pdev->dev.of_node);
if (mac)
memcpy(netdev->dev_addr, mac, IFHWADDRLEN);
priv->phy_id = -1;