From ca906c76a1a0a3cd69a8c49efd24c56d9e5f65f9 Mon Sep 17 00:00:00 2001 From: Fugang Duan Date: Fri, 10 May 2019 15:12:39 +0800 Subject: [PATCH] of_net: add property "nvmem-mac-address" for of_get_mac_addr() If MAC address read from nvmem cell and it is valid mac address, .of_get_mac_addr_nvmem() add new property "nvmem-mac-address" in ethernet node. Once user call .of_get_mac_address() to get MAC address again, it can read valid MAC address from device tree in directly. Signed-off-by: Fugang Duan --- drivers/of/of_net.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/of/of_net.c b/drivers/of/of_net.c index b02734aff8c1..2f9bcafcfed9 100644 --- a/drivers/of/of_net.c +++ b/drivers/of/of_net.c @@ -110,6 +110,10 @@ const void *of_get_mac_address(struct device_node *np) if (addr) return addr; + addr = of_get_mac_addr(np, "nvmem-mac-address"); + if (addr) + return addr; + return of_get_mac_addr_nvmem(np); } EXPORT_SYMBOL(of_get_mac_address);