From 28b162366d091e67e234ef1f0156127abc7f76e2 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 15 May 2021 08:07:08 +0200 Subject: [PATCH] mt76: fix calling mt76_get_of_eeprom with an offset for pre-cal data The device tree partition offset needs to be added to the function argument, instead of overwriting it. Fixes an issue where wrong EEPROM data was sent to the firmware as pre-calibration data on MT7915. Fixes: 495184ac91bb ("mt76: mt7915: add support for applying pre-calibration data") Signed-off-by: Felix Fietkau --- eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eeprom.c b/eeprom.c index aed9bcb2..cc74c372 100644 --- a/eeprom.c +++ b/eeprom.c @@ -51,7 +51,7 @@ int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int offset, int len) goto out_put_node; } - offset = be32_to_cpup(list); + offset += be32_to_cpup(list); ret = mtd_read(mtd, offset, len, &retlen, eep); put_mtd_device(mtd); if (ret)