aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath9k/debug.c
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-03-05 16:55:18 +0100
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 8d91422106d..0f7e249d2d2 100644
--- a/drivers/net/wireless/ath9k/debug.c
+++ b/drivers/net/wireless/ath9k/debug.c
@@ -19,6 +19,8 @@
static unsigned int ath9k_debug = DBG_DEFAULT;
module_param_named(debug, ath9k_debug, uint, 0);
+static struct dentry *ath9k_debugfs_root;
+
void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...)
{
if (!sc)
@@ -491,12 +493,8 @@ int ath9k_init_debug(struct ath_softc *sc)
{
sc->debug.debug_mask = ath9k_debug;
- sc->debug.debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
- if (!sc->debug.debugfs_root)
- goto err;
-
sc->debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
- sc->debug.debugfs_root);
+ ath9k_debugfs_root);
if (!sc->debug.debugfs_phy)
goto err;
@@ -538,5 +536,19 @@ void ath9k_exit_debug(struct ath_softc *sc)
debugfs_remove(sc->debug.debugfs_interrupt);
debugfs_remove(sc->debug.debugfs_dma);
debugfs_remove(sc->debug.debugfs_phy);
- debugfs_remove(sc->debug.debugfs_root);
+}
+
+int ath9k_debug_create_root(void)
+{
+ ath9k_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
+ if (!ath9k_debugfs_root)
+ return -ENOENT;
+
+ return 0;
+}
+
+void ath9k_debug_remove_root(void)
+{
+ debugfs_remove(ath9k_debugfs_root);
+ ath9k_debugfs_root = NULL;
}