mt76: eeprom: fix return code on corrected bit-flips

Ensure that the return code is 0 when data was read successfully

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2021-12-02 17:21:47 +01:00
parent 929a03a8d6
commit 71e08471ab
+3 -1
View File
@@ -65,7 +65,9 @@ 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 && !mtd_is_bitflip(ret)) {
if (mtd_is_bitflip(ret))
ret = 0;
if (ret) {
dev_err(dev->dev, "reading EEPROM from mtd %s failed: %i\n",
part, ret);
goto out_put_node;