ath9k: use debugfs_remove_recursive() instead of keeping pointers to all entries

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Felix Fietkau 2010-05-11 17:23:00 +02:00 committed by John W. Linville
parent 8116daf214
commit c8a72c00c6
2 changed files with 16 additions and 46 deletions

View file

@ -721,52 +721,36 @@ int ath9k_init_debug(struct ath_hw *ah)
sc->debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy), sc->debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
ath9k_debugfs_root); ath9k_debugfs_root);
if (!sc->debug.debugfs_phy) if (!sc->debug.debugfs_phy)
goto err; return -ENOMEM;
#ifdef CONFIG_ATH_DEBUG #ifdef CONFIG_ATH_DEBUG
sc->debug.debugfs_debug = debugfs_create_file("debug", if (!debugfs_create_file("debug", S_IRUSR | S_IWUSR,
S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc, &fops_debug); sc->debug.debugfs_phy, sc, &fops_debug))
if (!sc->debug.debugfs_debug)
goto err; goto err;
#endif #endif
sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUSR, if (!debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy,
sc->debug.debugfs_phy, sc, &fops_dma); sc, &fops_dma))
if (!sc->debug.debugfs_dma)
goto err; goto err;
sc->debug.debugfs_interrupt = debugfs_create_file("interrupt", if (!debugfs_create_file("interrupt", S_IRUSR, sc->debug.debugfs_phy,
S_IRUSR, sc, &fops_interrupt))
sc->debug.debugfs_phy,
sc, &fops_interrupt);
if (!sc->debug.debugfs_interrupt)
goto err; goto err;
sc->debug.debugfs_rcstat = debugfs_create_file("rcstat", if (!debugfs_create_file("rcstat", S_IRUSR, sc->debug.debugfs_phy,
S_IRUSR, sc, &fops_rcstat))
sc->debug.debugfs_phy,
sc, &fops_rcstat);
if (!sc->debug.debugfs_rcstat)
goto err; goto err;
sc->debug.debugfs_wiphy = debugfs_create_file( if (!debugfs_create_file("wiphy", S_IRUSR | S_IWUSR,
"wiphy", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc, sc->debug.debugfs_phy, sc, &fops_wiphy))
&fops_wiphy);
if (!sc->debug.debugfs_wiphy)
goto err; goto err;
sc->debug.debugfs_xmit = debugfs_create_file("xmit", if (!debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy,
S_IRUSR, sc, &fops_xmit))
sc->debug.debugfs_phy,
sc, &fops_xmit);
if (!sc->debug.debugfs_xmit)
goto err; goto err;
sc->debug.debugfs_recv = debugfs_create_file("recv", if (!debugfs_create_file("recv", S_IRUSR, sc->debug.debugfs_phy,
S_IRUSR, sc, &fops_recv))
sc->debug.debugfs_phy,
sc, &fops_recv);
if (!sc->debug.debugfs_recv)
goto err; goto err;
return 0; return 0;
@ -780,14 +764,7 @@ void ath9k_exit_debug(struct ath_hw *ah)
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
struct ath_softc *sc = (struct ath_softc *) common->priv; struct ath_softc *sc = (struct ath_softc *) common->priv;
debugfs_remove(sc->debug.debugfs_recv); debugfs_remove_recursive(sc->debug.debugfs_phy);
debugfs_remove(sc->debug.debugfs_xmit);
debugfs_remove(sc->debug.debugfs_wiphy);
debugfs_remove(sc->debug.debugfs_rcstat);
debugfs_remove(sc->debug.debugfs_interrupt);
debugfs_remove(sc->debug.debugfs_dma);
debugfs_remove(sc->debug.debugfs_debug);
debugfs_remove(sc->debug.debugfs_phy);
} }
int ath9k_debug_create_root(void) int ath9k_debug_create_root(void)

View file

@ -153,13 +153,6 @@ struct ath_stats {
struct ath9k_debug { struct ath9k_debug {
struct dentry *debugfs_phy; struct dentry *debugfs_phy;
struct dentry *debugfs_debug;
struct dentry *debugfs_dma;
struct dentry *debugfs_interrupt;
struct dentry *debugfs_rcstat;
struct dentry *debugfs_wiphy;
struct dentry *debugfs_xmit;
struct dentry *debugfs_recv;
struct ath_stats stats; struct ath_stats stats;
}; };