net: e1000: do not attempt to set hwaddr for i210 without FLASH
commit f1bcad22dd19 ("net: e1000: add support for writing to EEPROM")
adds support for storing hwaddr in EEPROM however i210 devices do not
support this and thus results in errors such as:
Warning: e1000#0 failed to set MAC address'
Check if a flash device is present and if not return -ENOSYS indicating
this is not supported.
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index 694114e..60613b7 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -5673,6 +5673,10 @@
DEBUGOUT("%s: mac=%pM\n", __func__, mac);
+ if ((hw->eeprom.type == e1000_eeprom_invm) &&
+ !(E1000_READ_REG(hw, EECD) & E1000_EECD_FLASH_DETECTED_I210))
+ return -ENOSYS;
+
memset(current_mac, 0, 6);
/* Read from EEPROM, not from registers, to make sure