From: David S. Miller Date: Tue, 13 Apr 2021 21:35:02 +0000 (-0700) Subject: Merge branch 'non-platform-devices-of_get_mac_address' X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=affb05d9109cbde23862691f7c8f0db4f8015c4e;p=linux.git Merge branch 'non-platform-devices-of_get_mac_address' Michael Walle says: ==================== of: net: support non-platform devices in of_get_mac_address() of_get_mac_address() is commonly used to fetch the MAC address from the device tree. It also supports reading it from a NVMEM provider. But the latter is only possible for platform devices, because only platform devices are searched for a matching device node. Add a second method to fetch the NVMEM cell by a device tree node instead of a "struct device". Moreover, the NVMEM subsystem will return dynamically allocated data which has to be freed after use. Currently, this is handled by allocating a device resource manged buffer to store the MAC address. of_get_mac_address() then returns a pointer to this buffer. Without a device, this trick is not possible anymore. Thus, change the of_get_mac_address() API to have the caller supply a buffer. It was considered to use the network device to attach the buffer to, but then the order matters and netdev_register() has to be called before of_get_mac_address(). No driver does it this way. ==================== Signed-off-by: David S. Miller --- affb05d9109cbde23862691f7c8f0db4f8015c4e