net: ethernet: mv643xx: Fix over zealous checking of_get_mac_address()
authorAndrew Lunn <andrew@lunn.ch>
Tue, 5 Apr 2022 00:04:04 +0000 (02:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 18:59:18 +0000 (20:59 +0200)
commit42b2e418f9a2ef7c8f3681ba544c2da59f4e005d
treea44f3a1e0da2dc40637059ca37f16818eddcd430
parent085d002432acb886c048bf27d15af537685727f7
net: ethernet: mv643xx: Fix over zealous checking of_get_mac_address()

[ Upstream commit 11f8e7c122ce013fa745029fa8c94c6db69c2e54 ]

There is often not a MAC address available in an EEPROM accessible by
Linux with Marvell devices. Instead the bootload has the MAC address
and directly programs it into the hardware. So don't consider an error
from of_get_mac_address() has fatal. However, the check was added for
the case where there is a MAC address in an the EEPROM, but the EEPROM
has not probed yet, and -EPROBE_DEFER is returned. In that case the
error should be returned. So make the check specific to this error
code.

Cc: Mauri Sandberg <maukka@ext.kapsi.fi>
Reported-by: Thomas Walther <walther-it@gmx.de>
Fixes: 42404d8f1c01 ("net: mv643xx_eth: process retval from of_get_mac_address")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220405000404.3374734-1-andrew@lunn.ch
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/mv643xx_eth.c