aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2010-10-12 13:55:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-13 15:45:21 -0400
commitd84a35d1323bc62f9b26a707072767a60da75015 (patch)
tree2750ab120868b8e830f3b337e626e8f0008b28b8 /drivers/net/wireless
parent10d8dad8453f8648a448960d7a2d3d983dfe0ed3 (diff)
ath5k: Move debugfs under ieee80211/[wiphy-name]
This automatically keeps things proper when wiphy is renamed. Based on patch by Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Ben Greear <greearb@candelatech.com> Acked-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c7
-rw-r--r--drivers/net/wireless/ath/ath5k/debug.c20
-rw-r--r--drivers/net/wireless/ath/ath5k/debug.h12
3 files changed, 3 insertions, 36 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 7baaf04f092d..f1ae75d35d5d 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -3541,8 +3541,6 @@ ath5k_pci_probe(struct pci_dev *pdev,
3541 sc->hw = hw; 3541 sc->hw = hw;
3542 sc->pdev = pdev; 3542 sc->pdev = pdev;
3543 3543
3544 ath5k_debug_init_device(sc);
3545
3546 /* 3544 /*
3547 * Mark the device as detached to avoid processing 3545 * Mark the device as detached to avoid processing
3548 * interrupts until setup is complete. 3546 * interrupts until setup is complete.
@@ -3650,6 +3648,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
3650 } 3648 }
3651 } 3649 }
3652 3650
3651 ath5k_debug_init_device(sc);
3653 3652
3654 /* ready to process interrupts */ 3653 /* ready to process interrupts */
3655 __clear_bit(ATH_STAT_INVALID, sc->status); 3654 __clear_bit(ATH_STAT_INVALID, sc->status);
@@ -3736,8 +3735,6 @@ init_ath5k_pci(void)
3736{ 3735{
3737 int ret; 3736 int ret;
3738 3737
3739 ath5k_debug_init();
3740
3741 ret = pci_register_driver(&ath5k_pci_driver); 3738 ret = pci_register_driver(&ath5k_pci_driver);
3742 if (ret) { 3739 if (ret) {
3743 printk(KERN_ERR "ath5k_pci: can't register pci driver\n"); 3740 printk(KERN_ERR "ath5k_pci: can't register pci driver\n");
@@ -3751,8 +3748,6 @@ static void __exit
3751exit_ath5k_pci(void) 3748exit_ath5k_pci(void)
3752{ 3749{
3753 pci_unregister_driver(&ath5k_pci_driver); 3750 pci_unregister_driver(&ath5k_pci_driver);
3754
3755 ath5k_debug_finish();
3756} 3751}
3757 3752
3758module_init(init_ath5k_pci); 3753module_init(init_ath5k_pci);
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index 7c77e5b7c9af..42ea5b1bdb12 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -72,8 +72,6 @@ module_param_named(debug, ath5k_debug, uint, 0);
72#include "reg.h" 72#include "reg.h"
73#include "ani.h" 73#include "ani.h"
74 74
75static struct dentry *ath5k_global_debugfs;
76
77static int ath5k_debugfs_open(struct inode *inode, struct file *file) 75static int ath5k_debugfs_open(struct inode *inode, struct file *file)
78{ 76{
79 file->private_data = inode->i_private; 77 file->private_data = inode->i_private;
@@ -882,21 +880,13 @@ static const struct file_operations fops_queue = {
882}; 880};
883 881
884 882
885/* init */
886
887void
888ath5k_debug_init(void)
889{
890 ath5k_global_debugfs = debugfs_create_dir("ath5k", NULL);
891}
892
893void 883void
894ath5k_debug_init_device(struct ath5k_softc *sc) 884ath5k_debug_init_device(struct ath5k_softc *sc)
895{ 885{
896 sc->debug.level = ath5k_debug; 886 sc->debug.level = ath5k_debug;
897 887
898 sc->debug.debugfs_phydir = debugfs_create_dir(wiphy_name(sc->hw->wiphy), 888 sc->debug.debugfs_phydir = debugfs_create_dir("ath5k",
899 ath5k_global_debugfs); 889 sc->hw->wiphy->debugfsdir);
900 890
901 sc->debug.debugfs_debug = debugfs_create_file("debug", 891 sc->debug.debugfs_debug = debugfs_create_file("debug",
902 S_IWUSR | S_IRUSR, 892 S_IWUSR | S_IRUSR,
@@ -937,12 +927,6 @@ ath5k_debug_init_device(struct ath5k_softc *sc)
937} 927}
938 928
939void 929void
940ath5k_debug_finish(void)
941{
942 debugfs_remove(ath5k_global_debugfs);
943}
944
945void
946ath5k_debug_finish_device(struct ath5k_softc *sc) 930ath5k_debug_finish_device(struct ath5k_softc *sc)
947{ 931{
948 debugfs_remove(sc->debug.debugfs_debug); 932 debugfs_remove(sc->debug.debugfs_debug);
diff --git a/drivers/net/wireless/ath/ath5k/debug.h b/drivers/net/wireless/ath/ath5k/debug.h
index 4f078b134015..236edbd2507d 100644
--- a/drivers/net/wireless/ath/ath5k/debug.h
+++ b/drivers/net/wireless/ath/ath5k/debug.h
@@ -138,15 +138,9 @@ enum ath5k_debug_level {
138 } while (0) 138 } while (0)
139 139
140void 140void
141ath5k_debug_init(void);
142
143void
144ath5k_debug_init_device(struct ath5k_softc *sc); 141ath5k_debug_init_device(struct ath5k_softc *sc);
145 142
146void 143void
147ath5k_debug_finish(void);
148
149void
150ath5k_debug_finish_device(struct ath5k_softc *sc); 144ath5k_debug_finish_device(struct ath5k_softc *sc);
151 145
152void 146void
@@ -174,15 +168,9 @@ ATH5K_DBG_UNLIMIT(struct ath5k_softc *sc, unsigned int m, const char *fmt, ...)
174{} 168{}
175 169
176static inline void 170static inline void
177ath5k_debug_init(void) {}
178
179static inline void
180ath5k_debug_init_device(struct ath5k_softc *sc) {} 171ath5k_debug_init_device(struct ath5k_softc *sc) {}
181 172
182static inline void 173static inline void
183ath5k_debug_finish(void) {}
184
185static inline void
186ath5k_debug_finish_device(struct ath5k_softc *sc) {} 174ath5k_debug_finish_device(struct ath5k_softc *sc) {}
187 175
188static inline void 176static inline void