1 --- a/drivers/of/of_net.c
2 +++ b/drivers/of/of_net.c
3 @@ -132,6 +132,30 @@ 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;
11 + prop = of_find_property(np, "mac-address", NULL);
15 + prop = kzalloc(sizeof(*prop), GFP_KERNEL);
19 + prop->name = "mac-address";
20 + prop->length = ETH_ALEN;
21 + prop->value = kmemdup(addr, ETH_ALEN, GFP_KERNEL);
22 + if (!prop->value || of_add_property(np, prop))
33 * Search the device tree for the best MAC address to use. 'mac-address' is
34 @@ -205,6 +232,7 @@ found:
35 if (!of_property_read_u32(np, "mac-address-increment", &mac_inc))
36 addr[inc_idx] += mac_inc;
38 + of_add_mac_address(np, addr);
41 EXPORT_SYMBOL(of_get_mac_address);