diff --git a/debugfs.c b/debugfs.c index aa2c0436..14edc8c0 100644 --- a/debugfs.c +++ b/debugfs.c @@ -111,6 +111,7 @@ void mt76_init_debugfs(struct mt76_dev *dev) return; debugfs_create_blob("eeprom", S_IRUSR, dir, &dev->eeprom); + debugfs_create_blob("otp", S_IRUSR, dir, &dev->otp); debugfs_create_u8("temperature", S_IRUSR, dir, &dev->cal.temp); debugfs_create_u32("regidx", S_IRUSR | S_IWUSR, dir, &dev->debugfs_reg); diff --git a/eeprom.c b/eeprom.c index 07bb14ce..de4a05d1 100644 --- a/eeprom.c +++ b/eeprom.c @@ -189,15 +189,16 @@ mt76_eeprom_load(struct mt76_dev *dev) bool found; dev->eeprom.size = len; - dev->eeprom.data = devm_kzalloc(dev->dev, len, GFP_KERNEL); + dev->eeprom.data = devm_kzalloc(dev->dev, len * 2, GFP_KERNEL); if (!dev->eeprom.data) return -ENOMEM; + dev->otp.size = len; + dev->otp.data = dev->eeprom.data + len; + found = !mt76_get_of_eeprom(dev, len); - efuse = kzalloc(len, GFP_KERNEL); - if (!efuse) - return -ENOMEM; + efuse = dev->otp.data; if (mt76_get_efuse_data(dev, efuse, len)) goto out; @@ -211,7 +212,6 @@ mt76_eeprom_load(struct mt76_dev *dev) } out: - kfree(efuse); if (!found) return -ENOENT; diff --git a/mt76.h b/mt76.h index a3ccaec3..f011d005 100644 --- a/mt76.h +++ b/mt76.h @@ -225,6 +225,7 @@ struct mt76_dev { struct mt76_calibration cal; struct debugfs_blob_wrapper eeprom; + struct debugfs_blob_wrapper otp; struct mt76_hw_cap cap; u32 debugfs_reg;