diff --git a/debugfs.c b/debugfs.c index fc8c35f6b..c8f66dcc5 100644 --- a/debugfs.c +++ b/debugfs.c @@ -63,6 +63,8 @@ struct dentry *mt76_register_debugfs(struct mt76_dev *dev) debugfs_create_u32("regidx", S_IRUSR | S_IWUSR, dir, &dev->debugfs_reg); debugfs_create_file("regval", S_IRUSR | S_IWUSR, dir, dev, &fops_regval); debugfs_create_blob("eeprom", S_IRUSR, dir, &dev->eeprom); + if (dev->otp.data) + debugfs_create_blob("otp", S_IRUSR, dir, &dev->otp); debugfs_create_devm_seqfile(dev->dev, "queues", dir, mt76_queues_read); return dir; diff --git a/mt76.h b/mt76.h index b995f1929..4dc013e8b 100644 --- a/mt76.h +++ b/mt76.h @@ -191,6 +191,7 @@ struct mt76_dev { struct ieee80211_supported_band sband_2g; struct ieee80211_supported_band sband_5g; struct debugfs_blob_wrapper eeprom; + struct debugfs_blob_wrapper otp; struct mt76_hw_cap cap; u32 debugfs_reg; diff --git a/mt76x2.h b/mt76x2.h index e8ad87426..50a2e578c 100644 --- a/mt76x2.h +++ b/mt76x2.h @@ -127,7 +127,6 @@ struct mt76x2_dev { u16 chainmask; struct mt76x2_calibration cal; - struct debugfs_blob_wrapper otp; s8 target_power; s8 target_power_delta[2]; diff --git a/mt76x2_debugfs.c b/mt76x2_debugfs.c index 64b8725bf..beb465c60 100644 --- a/mt76x2_debugfs.c +++ b/mt76x2_debugfs.c @@ -89,7 +89,6 @@ void mt76x2_init_debugfs(struct mt76x2_dev *dev) if (!dir) return; - debugfs_create_blob("otp", S_IRUSR, dir, &dev->otp); debugfs_create_u8("temperature", S_IRUSR, dir, &dev->cal.temp); debugfs_create_file("ampdu_stat", S_IRUSR, dir, dev, &fops_ampdu_stat); diff --git a/mt76x2_eeprom.c b/mt76x2_eeprom.c index f0a42c98a..563ba7c0f 100644 --- a/mt76x2_eeprom.c +++ b/mt76x2_eeprom.c @@ -223,12 +223,12 @@ mt76x2_eeprom_load(struct mt76x2_dev *dev) if (found) found = !mt76x2_check_eeprom(dev); - dev->otp.data = devm_kzalloc(dev->mt76.dev, len, GFP_KERNEL); - dev->otp.size = len; - if (!dev->otp.data) + dev->mt76.otp.data = devm_kzalloc(dev->mt76.dev, len, GFP_KERNEL); + dev->mt76.otp.size = len; + if (!dev->mt76.otp.data) return -ENOMEM; - efuse = dev->otp.data; + efuse = dev->mt76.otp.data; if (mt76x2_get_efuse_data(dev, efuse, len)) goto out;