]> 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)
commitf74af0fe896334d30e0cce23b540af9d6e801fd4
treef557abaef6b3106f623c47cdf0285fb87acaeb8d
parente06202983bf887f107abfd0d14722e7d2a9d984c
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