of: net: fix of_get_mac_addr_nvmem() for non-platform devices
authorMichael Walle <michael@walle.cc>
Mon, 12 Apr 2021 17:47:18 +0000 (19:47 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Apr 2021 21:35:02 +0000 (14:35 -0700)
commitf10843e04a075202dbb39dfcee047e3a2fdf5a8d
treef557abaef6b3106f623c47cdf0285fb87acaeb8d
parent83216e3988cd196183542937c9bd58b279f946af
of: net: fix of_get_mac_addr_nvmem() for non-platform devices

of_get_mac_address() already supports fetching the MAC address by an
nvmem provider. But until now, it was just working for platform devices.
Esp. it was not working for DSA ports and PCI devices. It gets more
common that PCI devices have a device tree binding since SoCs contain
integrated root complexes.

Use the nvmem of_* binding to fetch the nvmem cells by a struct
device_node. We still have to try to read the cell by device first
because there might be a nvmem_cell_lookup associated with that device.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/of/of_net.c