.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org> |
---|
3 | 4 | * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl> |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify |
---|
6 | | - * it under the terms of the GNU General Public License version 2 |
---|
7 | | - * as published by the Free Software Foundation |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope that it will be useful, |
---|
10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | | - * GNU General Public License for more details. |
---|
13 | 5 | */ |
---|
14 | 6 | |
---|
15 | 7 | #include <linux/debugfs.h> |
---|
.. | .. |
---|
35 | 27 | return 0; |
---|
36 | 28 | } |
---|
37 | 29 | |
---|
38 | | -DEFINE_SIMPLE_ATTRIBUTE(fops_regval, mt76_reg_get, mt76_reg_set, "0x%08llx\n"); |
---|
| 30 | +DEFINE_DEBUGFS_ATTRIBUTE(fops_regval, mt76_reg_get, mt76_reg_set, "0x%08llx\n"); |
---|
39 | 31 | |
---|
40 | 32 | static int |
---|
41 | | -mt7601u_ampdu_stat_read(struct seq_file *file, void *data) |
---|
| 33 | +mt7601u_ampdu_stat_show(struct seq_file *file, void *data) |
---|
42 | 34 | { |
---|
43 | 35 | struct mt7601u_dev *dev = file->private; |
---|
44 | 36 | int i, j; |
---|
.. | .. |
---|
81 | 73 | return 0; |
---|
82 | 74 | } |
---|
83 | 75 | |
---|
84 | | -static int |
---|
85 | | -mt7601u_ampdu_stat_open(struct inode *inode, struct file *f) |
---|
86 | | -{ |
---|
87 | | - return single_open(f, mt7601u_ampdu_stat_read, inode->i_private); |
---|
88 | | -} |
---|
89 | | - |
---|
90 | | -static const struct file_operations fops_ampdu_stat = { |
---|
91 | | - .open = mt7601u_ampdu_stat_open, |
---|
92 | | - .read = seq_read, |
---|
93 | | - .llseek = seq_lseek, |
---|
94 | | - .release = single_release, |
---|
95 | | -}; |
---|
| 76 | +DEFINE_SHOW_ATTRIBUTE(mt7601u_ampdu_stat); |
---|
96 | 77 | |
---|
97 | 78 | static int |
---|
98 | | -mt7601u_eeprom_param_read(struct seq_file *file, void *data) |
---|
| 79 | +mt7601u_eeprom_param_show(struct seq_file *file, void *data) |
---|
99 | 80 | { |
---|
100 | 81 | struct mt7601u_dev *dev = file->private; |
---|
101 | 82 | struct mt7601u_rate_power *rp = &dev->ee->power_rate_table; |
---|
.. | .. |
---|
139 | 120 | return 0; |
---|
140 | 121 | } |
---|
141 | 122 | |
---|
142 | | -static int |
---|
143 | | -mt7601u_eeprom_param_open(struct inode *inode, struct file *f) |
---|
144 | | -{ |
---|
145 | | - return single_open(f, mt7601u_eeprom_param_read, inode->i_private); |
---|
146 | | -} |
---|
147 | | - |
---|
148 | | -static const struct file_operations fops_eeprom_param = { |
---|
149 | | - .open = mt7601u_eeprom_param_open, |
---|
150 | | - .read = seq_read, |
---|
151 | | - .llseek = seq_lseek, |
---|
152 | | - .release = single_release, |
---|
153 | | -}; |
---|
| 123 | +DEFINE_SHOW_ATTRIBUTE(mt7601u_eeprom_param); |
---|
154 | 124 | |
---|
155 | 125 | void mt7601u_init_debugfs(struct mt7601u_dev *dev) |
---|
156 | 126 | { |
---|
.. | .. |
---|
165 | 135 | |
---|
166 | 136 | debugfs_create_u32("regidx", 0600, dir, &dev->debugfs_reg); |
---|
167 | 137 | debugfs_create_file("regval", 0600, dir, dev, &fops_regval); |
---|
168 | | - debugfs_create_file("ampdu_stat", 0400, dir, dev, &fops_ampdu_stat); |
---|
169 | | - debugfs_create_file("eeprom_param", 0400, dir, dev, &fops_eeprom_param); |
---|
| 138 | + debugfs_create_file("ampdu_stat", 0400, dir, dev, &mt7601u_ampdu_stat_fops); |
---|
| 139 | + debugfs_create_file("eeprom_param", 0400, dir, dev, &mt7601u_eeprom_param_fops); |
---|
170 | 140 | } |
---|