[PATCH] net/e1000: init eeprom word size if only iNVM is found

Lucas Stach l.stach at pengutronix.de
Tue Jan 23 06:41:29 PST 2018


The commit removing the iNVM enum type didn't make sure that the code path
initializing the word size is also executed when only the iNVM is present.
This leads to failed reads, as the read function will check the word size.

Fixes: 761bed13abcb (net/e1000: provide access to iNVM even if a
                     flash is present)
Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
 drivers/net/e1000/eeprom.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c
index 748d8afe7922..bf08ac87fdbb 100644
--- a/drivers/net/e1000/eeprom.c
+++ b/drivers/net/e1000/eeprom.c
@@ -506,7 +506,8 @@ int32_t e1000_init_eeprom_params(struct e1000_hw *hw)
 		break;
 	}
 
-	if (eeprom->type == e1000_eeprom_spi) {
+	/* SPI or iNVM */
+	if (!eeprom->word_size) {
 		/* eeprom_size will be an enum [0..8] that maps
 		 * to eeprom sizes 128B to
 		 * 32KB (incremented by powers of 2).
-- 
2.11.0




More information about the barebox mailing list