summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/aeroflex
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2017-03-21 13:24:38 +0300
committerDavid S. Miller <davem@davemloft.net>2017-03-22 22:00:39 +0300
commit726bceca81ba09956226ea03c9fb58e037c3db7d (patch)
treeaa7744082ce97f5ef2a6358735b200fde9b3d22d /drivers/net/ethernet/aeroflex
parent58ad3198342bda5eeb97c070dde76335bf0b7203 (diff)
downloadlinux-726bceca81ba09956226ea03c9fb58e037c3db7d.tar.xz
net: greth: 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: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/aeroflex')
-rw-r--r--drivers/net/ethernet/aeroflex/greth.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c
index 9f7422ada704..d8e133ced7b8 100644
--- a/drivers/net/ethernet/aeroflex/greth.c
+++ b/drivers/net/ethernet/aeroflex/greth.c
@@ -34,6 +34,7 @@
#include <linux/crc32.h>
#include <linux/mii.h>
#include <linux/of_device.h>
+#include <linux/of_net.h>
#include <linux/of_platform.h>
#include <linux/slab.h>
#include <asm/cacheflush.h>
@@ -1454,11 +1455,10 @@ static int greth_of_probe(struct platform_device *ofdev)
break;
}
if (i == 6) {
- const unsigned char *addr;
- int len;
- addr = of_get_property(ofdev->dev.of_node, "local-mac-address",
- &len);
- if (addr != NULL && len == 6) {
+ const u8 *addr;
+
+ addr = of_get_mac_address(ofdev->dev.of_node);
+ if (addr) {
for (i = 0; i < 6; i++)
macaddr[i] = (unsigned int) addr[i];
} else {