]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: manage errors returned by of_get_mac_address()
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sat, 27 Jul 2019 19:21:37 +0000 (21:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Jul 2019 17:57:10 +0000 (10:57 -0700)
commitd675ac950cf788662197b5e1e4a1305e2825eeb7
tree1ad3861917d92255d2ff308d9431a791415f22b4
parented3b7768f4e4196c6b748ad749b1dbfc76685c63
net: stmmac: manage errors returned by of_get_mac_address()

Commit fe45bccd460e ("of_net: add NVMEM support to of_get_mac_address")
added support for reading the MAC address from an nvmem-cell. This
required changing the logic to return an error pointer upon failure.

If stmmac is loaded before the nvmem provider driver then
of_get_mac_address() return an error pointer with -EPROBE_DEFER.

Propagate this error so the stmmac driver will be probed again after the
nvmem provider driver is loaded.
Default to a random generated MAC address in case of any other error,
instead of using the error pointer as MAC address.

Fixes: fe45bccd460e ("of_net: add NVMEM support to of_get_mac_address")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c