1 --- a/drivers/of/of_net.c
2 +++ b/drivers/of/of_net.c
3 @@ -95,6 +95,27 @@ static int of_get_mac_addr_nvmem(struct
7 +static int of_add_mac_address(struct device_node *np, u8* addr)
9 + struct property *prop;
11 + prop = kzalloc(sizeof(*prop), GFP_KERNEL);
15 + prop->name = "mac-address";
16 + prop->length = ETH_ALEN;
17 + prop->value = kmemdup(addr, ETH_ALEN, GFP_KERNEL);
18 + if (!prop->value || of_update_property(np, prop))
29 * Search the device tree for the best MAC address to use. 'mac-address' is
30 * checked first, because that is supposed to contain to "most recent" MAC
31 @@ -161,6 +182,7 @@ found:
32 if (!of_property_read_u32(np, "mac-address-increment", &mac_inc))
33 addr[inc_idx] += mac_inc;
35 + of_add_mac_address(np, addr);
38 EXPORT_SYMBOL(of_get_mac_address);