aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/debugfs_sta.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-10-27 07:59:03 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-30 16:49:18 -0400
commit7bcfaf2f431c09c51fe776fc06638b25d3b421c5 (patch)
tree27f767335566826f11f0134b97ee76b58d9bcf90 /net/mac80211/debugfs_sta.c
parent2c0d6100da3ee9b0f0cc46add9bb8a8161299a92 (diff)
cfg80211/mac80211: use debugfs_remove_recursive
We can save a lot of code and pointers in the structs by using debugfs_remove_recursive(). First, change cfg80211 to use debugfs_remove_recursive() so that drivers do not need to clean up any files they added to the per-wiphy debugfs (if and only if they are ok to be accessed until after wiphy_unregister!). Then also make mac80211 use debugfs_remove_recursive() where necessary -- it need not remove per-wiphy files as cfg80211 now removes those, but netdev etc. files still need to be handled but can now be removed without needing struct dentry pointers to all of them. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/debugfs_sta.c')
-rw-r--r--net/mac80211/debugfs_sta.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 33a2e892115b..8721679773da 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -158,13 +158,9 @@ static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf,
158STA_OPS(agg_status); 158STA_OPS(agg_status);
159 159
160#define DEBUGFS_ADD(name) \ 160#define DEBUGFS_ADD(name) \
161 sta->debugfs.name = debugfs_create_file(#name, 0400, \ 161 debugfs_create_file(#name, 0400, \
162 sta->debugfs.dir, sta, &sta_ ##name## _ops); 162 sta->debugfs.dir, sta, &sta_ ##name## _ops);
163 163
164#define DEBUGFS_DEL(name) \
165 debugfs_remove(sta->debugfs.name);\
166 sta->debugfs.name = NULL;
167
168 164
169void ieee80211_sta_debugfs_add(struct sta_info *sta) 165void ieee80211_sta_debugfs_add(struct sta_info *sta)
170{ 166{
@@ -216,29 +212,6 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
216 212
217void ieee80211_sta_debugfs_remove(struct sta_info *sta) 213void ieee80211_sta_debugfs_remove(struct sta_info *sta)
218{ 214{
219 DEBUGFS_DEL(flags); 215 debugfs_remove_recursive(sta->debugfs.dir);
220 DEBUGFS_DEL(num_ps_buf_frames);
221 DEBUGFS_DEL(inactive_ms);
222 DEBUGFS_DEL(last_seq_ctrl);
223 DEBUGFS_DEL(agg_status);
224 DEBUGFS_DEL(aid);
225 DEBUGFS_DEL(dev);
226 DEBUGFS_DEL(rx_packets);
227 DEBUGFS_DEL(tx_packets);
228 DEBUGFS_DEL(rx_bytes);
229 DEBUGFS_DEL(tx_bytes);
230 DEBUGFS_DEL(rx_duplicates);
231 DEBUGFS_DEL(rx_fragments);
232 DEBUGFS_DEL(rx_dropped);
233 DEBUGFS_DEL(tx_fragments);
234 DEBUGFS_DEL(tx_filtered);
235 DEBUGFS_DEL(tx_retry_failed);
236 DEBUGFS_DEL(tx_retry_count);
237 DEBUGFS_DEL(last_signal);
238 DEBUGFS_DEL(last_qual);
239 DEBUGFS_DEL(last_noise);
240 DEBUGFS_DEL(wep_weak_iv_count);
241
242 debugfs_remove(sta->debugfs.dir);
243 sta->debugfs.dir = NULL; 216 sta->debugfs.dir = NULL;
244} 217}