]> git.baikalelectronics.ru Git - kernel.git/commit
of_net: add NVMEM support to of_get_mac_address
authorPetr Štetiar <ynezz@true.cz>
Fri, 3 May 2019 14:27:06 +0000 (16:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 May 2019 04:47:07 +0000 (21:47 -0700)
commitfe45bccd460ed56ab6f7fb83d073a0e4a67d3238
tree5494aee8663654b70f4c5bdd85fbd2f270d24662
parentb8cee15bfd324bb64244b8e8b086c30af4348007
of_net: add NVMEM support to of_get_mac_address

Many embedded devices have information such as MAC addresses stored
inside NVMEMs like EEPROMs and so on. Currently there are only two
drivers in the tree which benefit from NVMEM bindings.

Adding support for NVMEM into every other driver would mean adding a lot
of repetitive code. This patch allows us to configure MAC addresses in
various devices like ethernet and wireless adapters directly from
of_get_mac_address, which is already used by almost every driver in the
tree.

Predecessor of this patch which used directly MTD layer has originated
in OpenWrt some time ago and supports already about 497 use cases in 357
device tree files.

Cc: Alban Bedel <albeu@free.fr>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/of/of_net.c