Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Florian Fainelli and committed by
David S. Miller
b34296a9 abf7e53e

+3 -4
+3 -4
drivers/net/ethernet/ethoc.c
··· 23 23 #include <linux/sched.h> 24 24 #include <linux/slab.h> 25 25 #include <linux/of.h> 26 + #include <linux/of_net.h> 26 27 #include <linux/module.h> 27 28 #include <net/ethoc.h> 28 29 ··· 1159 1158 memcpy(netdev->dev_addr, pdata->hwaddr, IFHWADDRLEN); 1160 1159 priv->phy_id = pdata->phy_id; 1161 1160 } else { 1162 - const uint8_t *mac; 1161 + const void *mac; 1163 1162 1164 - mac = of_get_property(pdev->dev.of_node, 1165 - "local-mac-address", 1166 - NULL); 1163 + mac = of_get_mac_address(pdev->dev.of_node); 1167 1164 if (mac) 1168 1165 memcpy(netdev->dev_addr, mac, IFHWADDRLEN); 1169 1166 priv->phy_id = -1;