diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/debug.c')
-rw-r--r-- | drivers/net/wireless/ath9k/debug.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath9k/debug.c b/drivers/net/wireless/ath9k/debug.c index 31af7cc0fa34..c146e484ef54 100644 --- a/drivers/net/wireless/ath9k/debug.c +++ b/drivers/net/wireless/ath9k/debug.c | |||
@@ -24,7 +24,7 @@ void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...) | |||
24 | if (!sc) | 24 | if (!sc) |
25 | return; | 25 | return; |
26 | 26 | ||
27 | if (sc->sc_debug & dbg_mask) { | 27 | if (sc->sc_debug.debug_mask & dbg_mask) { |
28 | va_list args; | 28 | va_list args; |
29 | 29 | ||
30 | va_start(args, fmt); | 30 | va_start(args, fmt); |
@@ -34,7 +34,27 @@ void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...) | |||
34 | } | 34 | } |
35 | } | 35 | } |
36 | 36 | ||
37 | void ath9k_init_debug(struct ath_softc *sc) | 37 | int ath9k_init_debug(struct ath_softc *sc) |
38 | { | 38 | { |
39 | sc->sc_debug = ath9k_debug; | 39 | sc->sc_debug.debug_mask = ath9k_debug; |
40 | |||
41 | sc->sc_debug.debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL); | ||
42 | if (!sc->sc_debug.debugfs_root) | ||
43 | goto err; | ||
44 | |||
45 | sc->sc_debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy), | ||
46 | sc->sc_debug.debugfs_root); | ||
47 | if (!sc->sc_debug.debugfs_phy) | ||
48 | goto err; | ||
49 | |||
50 | return 0; | ||
51 | err: | ||
52 | ath9k_exit_debug(sc); | ||
53 | return -ENOMEM; | ||
54 | } | ||
55 | |||
56 | void ath9k_exit_debug(struct ath_softc *sc) | ||
57 | { | ||
58 | debugfs_remove(sc->sc_debug.debugfs_phy); | ||
59 | debugfs_remove(sc->sc_debug.debugfs_root); | ||
40 | } | 60 | } |