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

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
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;

+2 −2
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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;