From: Tobias Klauser Date: Tue, 21 Mar 2017 10:24:38 +0000 (+0100) Subject: net: greth: Utilize of_get_mac_address() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=726bceca81ba09956226ea03c9fb58e037c3db7d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: David S. Miller --- 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 #include #include +#include #include #include #include @@ -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 {