Skip to content

Commit

Permalink
mt76: eeprom: tolerate corrected bit-flips
Browse files Browse the repository at this point in the history
mtd_read() returns -EUCLEAN in case of corrected bit-flips.
As data was read, don't error out in this case.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
Daniel Golle authored and Felix Fietkau committed Dec 19, 2021
1 parent 15965d8 commit 5b595b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/mediatek/mt76/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ 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 (mtd_is_bitflip(ret))
ret = 0;
if (ret) {
dev_err(dev->dev, "reading EEPROM from mtd %s failed: %i\n",
part, ret);
Expand Down

0 comments on commit 5b595b6

Please sign in to comment.