Am 2021-04-07 00:09, schrieb Michael Walle:
[..]
diff --git a/drivers/of/of_net.c b/drivers/of/of_net.c
index bc0a27de69d4..2d5d5e59aea5 100644
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
@@ -45,42 +45,35 @@ int of_get_phy_mode(struct device_node *np,
phy_interface_t *interface)
 }
 EXPORT_SYMBOL_GPL(of_get_phy_mode);

-static const void *of_get_mac_addr(struct device_node *np, const char *name) +static int of_get_mac_addr(struct device_node *np, const char *name, u8 *addr)
 {
        struct property *pp = of_find_property(np, name, NULL);

-       if (pp && pp->length == ETH_ALEN && is_valid_ether_addr(pp->value))
-               return pp->value;
-       return NULL;
+       if (pp && pp->length == ETH_ALEN && is_valid_ether_addr(pp->value)) {
+               ether_addr_copy(addr, pp->value);

Mh, I guess this should rather be memcpy(addr, pp->value, ETH_ALEN) because
ether_addr_copy() needs 2 byte aligned source and destination buffers.

-michael

Reply via email to