Skip to content

Commit b34296a

Browse files
ffainellidavem330
authored andcommitted
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 <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> Acked-by: Thierry Reding <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent abf7e53 commit b34296a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/net/ethernet/ethoc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/sched.h>
2424
#include <linux/slab.h>
2525
#include <linux/of.h>
26+
#include <linux/of_net.h>
2627
#include <linux/module.h>
2728
#include <net/ethoc.h>
2829

@@ -1158,11 +1159,9 @@ static int ethoc_probe(struct platform_device *pdev)
11581159
memcpy(netdev->dev_addr, pdata->hwaddr, IFHWADDRLEN);
11591160
priv->phy_id = pdata->phy_id;
11601161
} else {
1161-
const uint8_t *mac;
1162+
const void *mac;
11621163

1163-
mac = of_get_property(pdev->dev.of_node,
1164-
"local-mac-address",
1165-
NULL);
1164+
mac = of_get_mac_address(pdev->dev.of_node);
11661165
if (mac)
11671166
memcpy(netdev->dev_addr, mac, IFHWADDRLEN);
11681167
priv->phy_id = -1;

0 commit comments

Comments
 (0)