]> git.karo-electronics.de Git - linux-beck.git/commitdiff
net: ethoc: Utilize of_get_mac_address()
authorFlorian Fainelli <f.fainelli@gmail.com>
Sun, 4 Dec 2016 20:40:29 +0000 (12:40 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Dec 2016 20:30:03 +0000 (15:30 -0500)
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>
drivers/net/ethernet/ethoc.c

index 877c02a36c85a5ebae5b17af848d69335e35fa5a..8d0cb5ce87ee5e4bbfd767d5cbde51754ea1bb4c 100644 (file)
@@ -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;