Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135226
b: refs/heads/master
c: 19d8bc2
h: refs/heads/master
v: v3
  • Loading branch information
Gabor Juhos authored and John W. Linville committed Mar 16, 2009
1 parent 6a14a54 commit 558c8c2
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0eeb59fe2cd84b62f374874a59e62402e13f48b3
refs/heads/master: 19d8bc22bcea749da2ba065a1ff9e054fadb556e
24 changes: 18 additions & 6 deletions trunk/drivers/net/wireless/ath9k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
12 changes: 11 additions & 1 deletion trunk/drivers/net/wireless/ath9k/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ struct ath_stats {

struct ath9k_debug {
int debug_mask;
struct dentry *debugfs_root;
struct dentry *debugfs_phy;
struct dentry *debugfs_dma;
struct dentry *debugfs_interrupt;
Expand All @@ -114,6 +113,8 @@ struct ath9k_debug {
void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...);
int ath9k_init_debug(struct ath_softc *sc);
void ath9k_exit_debug(struct ath_softc *sc);
int ath9k_debug_create_root(void);
void ath9k_debug_remove_root(void);
void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
void ath_debug_stat_rc(struct ath_softc *sc, struct sk_buff *skb);
void ath_debug_stat_retries(struct ath_softc *sc, int rix,
Expand All @@ -135,6 +136,15 @@ static inline void ath9k_exit_debug(struct ath_softc *sc)
{
}

static inline int ath9k_debug_create_root(void)
{
return 0;
}

static inline void ath9k_debug_remove_root(void)
{
}

static inline void ath_debug_stat_interrupt(struct ath_softc *sc,
enum ath9k_int status)
{
Expand Down
13 changes: 12 additions & 1 deletion trunk/drivers/net/wireless/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2858,12 +2858,20 @@ static int __init ath9k_init(void)
goto err_out;
}

error = ath9k_debug_create_root();
if (error) {
printk(KERN_ERR
"ath9k: Unable to create debugfs root: %d\n",
error);
goto err_rate_unregister;
}

error = ath_pci_init();
if (error < 0) {
printk(KERN_ERR
"ath9k: No PCI devices found, driver not installed.\n");
error = -ENODEV;
goto err_rate_unregister;
goto err_remove_root;
}

error = ath_ahb_init();
Expand All @@ -2877,6 +2885,8 @@ static int __init ath9k_init(void)
err_pci_exit:
ath_pci_exit();

err_remove_root:
ath9k_debug_remove_root();
err_rate_unregister:
ath_rate_control_unregister();
err_out:
Expand All @@ -2888,6 +2898,7 @@ static void __exit ath9k_exit(void)
{
ath_ahb_exit();
ath_pci_exit();
ath9k_debug_remove_root();
ath_rate_control_unregister();
printk(KERN_INFO "%s: Driver unloaded\n", dev_info);
}
Expand Down

0 comments on commit 558c8c2

Please sign in to comment.