]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit113b4cc1389daa929365901e9b0656c5539ad644
treef557abaef6b3106f623c47cdf0285fb87acaeb8d
parentfaff74d1225bd36e9c06be9e956a195261f9b049
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