1 --- a/drivers/of/of_net.c
2 +++ b/drivers/of/of_net.c
3 @@ -132,6 +132,33 @@ static void *of_get_mac_address_mtd(stru
7 +static int of_add_mac_address(struct device_node *np, u8* addr)
9 + struct property *prop;
12 + np_addr = of_get_mac_addr(np, "mac-address");
14 + memcpy(np_addr, addr, ETH_ALEN);
18 + prop = kzalloc(sizeof(*prop), GFP_KERNEL);
22 + prop->name = "mac-address";
23 + prop->length = ETH_ALEN;
24 + prop->value = kmemdup(addr, ETH_ALEN, GFP_KERNEL);
25 + if (!prop->value || of_add_property(np, prop))
36 * Search the device tree for the best MAC address to use. 'mac-address' is
37 @@ -205,6 +232,7 @@ found:
38 if (!of_property_read_u32(np, "mac-address-increment", &mac_inc))
39 addr[inc_idx] += mac_inc;
41 + of_add_mac_address(np, addr);
44 EXPORT_SYMBOL(of_get_mac_address);