mt76: rely on phy pointer in mt76_register_debugfs_fops routine signature

This is a preliminary patch to create a mt76 debugfs subir for ext-phy.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Lorenzo Bianconi 2021-10-11 12:38:27 +02:00 committed by Felix Fietkau
parent e5a9f38313
commit 3263039d75
4 changed files with 7 additions and 6 deletions

View File

@ -118,13 +118,14 @@ static int mt76_read_rate_txpower(struct seq_file *s, void *data)
}
struct dentry *
mt76_register_debugfs_fops(struct mt76_dev *dev,
mt76_register_debugfs_fops(struct mt76_phy *phy,
const struct file_operations *ops)
{
const struct file_operations *fops = ops ? ops : &fops_regval;
struct mt76_dev *dev = phy->dev;
struct dentry *dir;
dir = debugfs_create_dir("mt76", dev->hw->wiphy->debugfsdir);
dir = debugfs_create_dir("mt76", phy->hw->wiphy->debugfsdir);
if (!dir)
return NULL;

View File

@ -888,11 +888,11 @@ struct mt76_phy *mt76_alloc_phy(struct mt76_dev *dev, unsigned int size,
int mt76_register_phy(struct mt76_phy *phy, bool vht,
struct ieee80211_rate *rates, int n_rates);
struct dentry *mt76_register_debugfs_fops(struct mt76_dev *dev,
struct dentry *mt76_register_debugfs_fops(struct mt76_phy *phy,
const struct file_operations *ops);
static inline struct dentry *mt76_register_debugfs(struct mt76_dev *dev)
{
return mt76_register_debugfs_fops(dev, NULL);
return mt76_register_debugfs_fops(&dev->phy, NULL);
}
int mt76_queues_read(struct seq_file *s, void *data);

View File

@ -533,7 +533,7 @@ int mt7615_init_debugfs(struct mt7615_dev *dev)
{
struct dentry *dir;
dir = mt76_register_debugfs_fops(&dev->mt76, &fops_regval);
dir = mt76_register_debugfs_fops(&dev->mphy, &fops_regval);
if (!dir)
return -ENOMEM;

View File

@ -417,7 +417,7 @@ int mt7921_init_debugfs(struct mt7921_dev *dev)
{
struct dentry *dir;
dir = mt76_register_debugfs_fops(&dev->mt76, &fops_regval);
dir = mt76_register_debugfs_fops(&dev->mphy, &fops_regval);
if (!dir)
return -ENOMEM;