aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/debug.c
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-03-05 10:55:18 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-03-16 18:09:27 -0400
commit19d8bc22bcea749da2ba065a1ff9e054fadb556e (patch)
tree69c5d473198e963bdb298fb9411e1f52f7770067 /drivers/net/wireless/ath9k/debug.c
parent0eeb59fe2cd84b62f374874a59e62402e13f48b3 (diff)
ath9k: create a common debugfs_root for all device instances
The driver are trying to create an 'ath9k' directory in debugfs for each device currently. If there are more than one device in the system, the second try will always fail. Changes-licensed-under: ISC Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Imre Kaloz <kaloz@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/debug.c')
-rw-r--r--drivers/net/wireless/ath9k/debug.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath9k/debug.c b/drivers/net/wireless/ath9k/debug.c
index 8d91422106d9..0f7e249d2d2e 100644
--- a/drivers/net/wireless/ath9k/debug.c
+++ b/drivers/net/wireless/ath9k/debug.c
@@ -19,6 +19,8 @@
19static unsigned int ath9k_debug = DBG_DEFAULT; 19static unsigned int ath9k_debug = DBG_DEFAULT;
20module_param_named(debug, ath9k_debug, uint, 0); 20module_param_named(debug, ath9k_debug, uint, 0);
21 21
22static struct dentry *ath9k_debugfs_root;
23
22void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...) 24void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...)
23{ 25{
24 if (!sc) 26 if (!sc)
@@ -491,12 +493,8 @@ int ath9k_init_debug(struct ath_softc *sc)
491{ 493{
492 sc->debug.debug_mask = ath9k_debug; 494 sc->debug.debug_mask = ath9k_debug;
493 495
494 sc->debug.debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
495 if (!sc->debug.debugfs_root)
496 goto err;
497
498 sc->debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy), 496 sc->debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
499 sc->debug.debugfs_root); 497 ath9k_debugfs_root);
500 if (!sc->debug.debugfs_phy) 498 if (!sc->debug.debugfs_phy)
501 goto err; 499 goto err;
502 500
@@ -538,5 +536,19 @@ void ath9k_exit_debug(struct ath_softc *sc)
538 debugfs_remove(sc->debug.debugfs_interrupt); 536 debugfs_remove(sc->debug.debugfs_interrupt);
539 debugfs_remove(sc->debug.debugfs_dma); 537 debugfs_remove(sc->debug.debugfs_dma);
540 debugfs_remove(sc->debug.debugfs_phy); 538 debugfs_remove(sc->debug.debugfs_phy);
541 debugfs_remove(sc->debug.debugfs_root); 539}
540
541int ath9k_debug_create_root(void)
542{
543 ath9k_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
544 if (!ath9k_debugfs_root)
545 return -ENOENT;
546
547 return 0;
548}
549
550void ath9k_debug_remove_root(void)
551{
552 debugfs_remove(ath9k_debugfs_root);
553 ath9k_debugfs_root = NULL;
542} 554}