diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2021-10-22 23:41:40 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-10-23 13:23:45 +0200 |
commit | 2c4766fd5d3d390cbdd1f71eacee13a756d8ef0e (patch) | |
tree | 5f618d16d7be41fc34fe0b7dee55ba63e360b47d /drivers/net/wireless/mediatek/mt76 | |
parent | 565ddaaab9a15424a9037f929bce685aa34ffd0b (diff) | |
download | linux-stable-2c4766fd5d3d390cbdd1f71eacee13a756d8ef0e.tar.gz linux-stable-2c4766fd5d3d390cbdd1f71eacee13a756d8ef0e.tar.bz2 linux-stable-2c4766fd5d3d390cbdd1f71eacee13a756d8ef0e.zip |
mt76: Print error message when reading EEPROM from mtd failed
When the EEPROM data is stored on a MTD partition print an error message
when reading this MTD partition failed. This is currently happening
often in OpenWrt because the initial data was written with using a flash
driver which ignores the error detection data and now OpenWrt uses a
driver which checks it.
With this patch a better error message is shown:
[ 8.986988] mt7915e 0000:01:00.0: WA Firmware Version: DEV_000000, Build Time: 20201105222323
[ 9.100508] mt7915e 0000:01:00.0: reading EEPROM from mtd factory failed: -117
[ 9.144289] mt7915e: probe of 0000:01:00.0 failed with error -22
mt7915 does not work without an EEPROM, MT7922 still works.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/eeprom.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c index e65b2262e692..2d58aa31db93 100644 --- a/drivers/net/wireless/mediatek/mt76/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/eeprom.c @@ -65,8 +65,11 @@ int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int offset, int len) offset = be32_to_cpup(list); ret = mtd_read(mtd, offset, len, &retlen, eep); put_mtd_device(mtd); - if (ret) + if (ret) { + dev_err(dev->dev, "reading EEPROM from mtd %s failed: %i\n", + part, ret); goto out_put_node; + } if (retlen < len) { ret = -EINVAL; |