Skip to content

Commit

Permalink
mt76: rely on phy pointer in mt76_register_debugfs_fops routine signa…
Browse files Browse the repository at this point in the history
…ture

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>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed Oct 19, 2021
1 parent 8c9d4b3 commit d0ccc42
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions debugfs.c
Expand Up @@ -92,13 +92,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;

Expand Down
4 changes: 2 additions & 2 deletions mt76.h
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion mt7615/debugfs.c
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion mt7921/debugfs.c
Expand Up @@ -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;

Expand Down

0 comments on commit d0ccc42

Please sign in to comment.