Commit 3263039d authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

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: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent e5a9f383
...@@ -118,13 +118,14 @@ static int mt76_read_rate_txpower(struct seq_file *s, void *data) ...@@ -118,13 +118,14 @@ static int mt76_read_rate_txpower(struct seq_file *s, void *data)
} }
struct dentry * 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 *ops)
{ {
const struct file_operations *fops = ops ? ops : &fops_regval; const struct file_operations *fops = ops ? ops : &fops_regval;
struct mt76_dev *dev = phy->dev;
struct dentry *dir; struct dentry *dir;
dir = debugfs_create_dir("mt76", dev->hw->wiphy->debugfsdir); dir = debugfs_create_dir("mt76", phy->hw->wiphy->debugfsdir);
if (!dir) if (!dir)
return NULL; return NULL;
......
...@@ -888,11 +888,11 @@ struct mt76_phy *mt76_alloc_phy(struct mt76_dev *dev, unsigned int size, ...@@ -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, int mt76_register_phy(struct mt76_phy *phy, bool vht,
struct ieee80211_rate *rates, int n_rates); 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); const struct file_operations *ops);
static inline struct dentry *mt76_register_debugfs(struct mt76_dev *dev) 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); int mt76_queues_read(struct seq_file *s, void *data);
......
...@@ -533,7 +533,7 @@ int mt7615_init_debugfs(struct mt7615_dev *dev) ...@@ -533,7 +533,7 @@ int mt7615_init_debugfs(struct mt7615_dev *dev)
{ {
struct dentry *dir; struct dentry *dir;
dir = mt76_register_debugfs_fops(&dev->mt76, &fops_regval); dir = mt76_register_debugfs_fops(&dev->mphy, &fops_regval);
if (!dir) if (!dir)
return -ENOMEM; return -ENOMEM;
......
...@@ -417,7 +417,7 @@ int mt7921_init_debugfs(struct mt7921_dev *dev) ...@@ -417,7 +417,7 @@ int mt7921_init_debugfs(struct mt7921_dev *dev)
{ {
struct dentry *dir; struct dentry *dir;
dir = mt76_register_debugfs_fops(&dev->mt76, &fops_regval); dir = mt76_register_debugfs_fops(&dev->mphy, &fops_regval);
if (!dir) if (!dir)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment