Commit 5b7916ad authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

ath5k: clean up debugfs code

The pointers to the debugfs entries do not need to be saved, because they
will be recursively removed when the wiphy is unregistered.
Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ed895085
...@@ -2901,7 +2901,6 @@ ath5k_deinit_softc(struct ath5k_softc *sc) ...@@ -2901,7 +2901,6 @@ ath5k_deinit_softc(struct ath5k_softc *sc)
* XXX: ??? detach ath5k_hw ??? * XXX: ??? detach ath5k_hw ???
* Other than that, it's straightforward... * Other than that, it's straightforward...
*/ */
ath5k_debug_finish_device(sc);
ieee80211_unregister_hw(hw); ieee80211_unregister_hw(hw);
ath5k_desc_free(sc); ath5k_desc_free(sc);
ath5k_txq_release(sc); ath5k_txq_release(sc);
......
...@@ -888,65 +888,38 @@ static const struct file_operations fops_queue = { ...@@ -888,65 +888,38 @@ static const struct file_operations fops_queue = {
void void
ath5k_debug_init_device(struct ath5k_softc *sc) ath5k_debug_init_device(struct ath5k_softc *sc)
{ {
sc->debug.level = ath5k_debug; struct dentry *phydir;
sc->debug.debugfs_phydir = debugfs_create_dir("ath5k", sc->debug.level = ath5k_debug;
sc->hw->wiphy->debugfsdir);
sc->debug.debugfs_debug = debugfs_create_file("debug", phydir = debugfs_create_dir("ath5k", sc->hw->wiphy->debugfsdir);
S_IWUSR | S_IRUSR, if (!phydir)
sc->debug.debugfs_phydir, sc, &fops_debug); return;
sc->debug.debugfs_registers = debugfs_create_file("registers", S_IRUSR, debugfs_create_file("debug", S_IWUSR | S_IRUSR, phydir, sc,
sc->debug.debugfs_phydir, sc, &fops_registers); &fops_debug);
sc->debug.debugfs_beacon = debugfs_create_file("beacon", debugfs_create_file("registers", S_IRUSR, phydir, sc, &fops_registers);
S_IWUSR | S_IRUSR,
sc->debug.debugfs_phydir, sc, &fops_beacon);
sc->debug.debugfs_reset = debugfs_create_file("reset", S_IWUSR, debugfs_create_file("beacon", S_IWUSR | S_IRUSR, phydir, sc,
sc->debug.debugfs_phydir, sc, &fops_reset); &fops_beacon);
sc->debug.debugfs_antenna = debugfs_create_file("antenna", debugfs_create_file("reset", S_IWUSR, phydir, sc, &fops_reset);
S_IWUSR | S_IRUSR,
sc->debug.debugfs_phydir, sc, &fops_antenna);
sc->debug.debugfs_misc = debugfs_create_file("misc", debugfs_create_file("antenna", S_IWUSR | S_IRUSR, phydir, sc,
S_IRUSR, &fops_antenna);
sc->debug.debugfs_phydir, sc, &fops_misc);
sc->debug.debugfs_frameerrors = debugfs_create_file("frameerrors", debugfs_create_file("misc", S_IRUSR, phydir, sc, &fops_misc);
S_IWUSR | S_IRUSR,
sc->debug.debugfs_phydir, sc,
&fops_frameerrors);
sc->debug.debugfs_ani = debugfs_create_file("ani", debugfs_create_file("frameerrors", S_IWUSR | S_IRUSR, phydir, sc,
S_IWUSR | S_IRUSR, &fops_frameerrors);
sc->debug.debugfs_phydir, sc,
&fops_ani);
sc->debug.debugfs_queue = debugfs_create_file("queue", debugfs_create_file("ani", S_IWUSR | S_IRUSR, phydir, sc, &fops_ani);
S_IWUSR | S_IRUSR,
sc->debug.debugfs_phydir, sc,
&fops_queue);
}
void debugfs_create_file("queue", S_IWUSR | S_IRUSR, phydir, sc,
ath5k_debug_finish_device(struct ath5k_softc *sc) &fops_queue);
{
debugfs_remove(sc->debug.debugfs_debug);
debugfs_remove(sc->debug.debugfs_registers);
debugfs_remove(sc->debug.debugfs_beacon);
debugfs_remove(sc->debug.debugfs_reset);
debugfs_remove(sc->debug.debugfs_antenna);
debugfs_remove(sc->debug.debugfs_misc);
debugfs_remove(sc->debug.debugfs_frameerrors);
debugfs_remove(sc->debug.debugfs_ani);
debugfs_remove(sc->debug.debugfs_queue);
debugfs_remove(sc->debug.debugfs_phydir);
} }
/* functions used in other places */ /* functions used in other places */
void void
......
...@@ -68,17 +68,6 @@ struct ath5k_buf; ...@@ -68,17 +68,6 @@ struct ath5k_buf;
struct ath5k_dbg_info { struct ath5k_dbg_info {
unsigned int level; /* debug level */ unsigned int level; /* debug level */
/* debugfs entries */
struct dentry *debugfs_phydir;
struct dentry *debugfs_debug;
struct dentry *debugfs_registers;
struct dentry *debugfs_beacon;
struct dentry *debugfs_reset;
struct dentry *debugfs_antenna;
struct dentry *debugfs_misc;
struct dentry *debugfs_frameerrors;
struct dentry *debugfs_ani;
struct dentry *debugfs_queue;
}; };
/** /**
...@@ -140,9 +129,6 @@ enum ath5k_debug_level { ...@@ -140,9 +129,6 @@ enum ath5k_debug_level {
void void
ath5k_debug_init_device(struct ath5k_softc *sc); ath5k_debug_init_device(struct ath5k_softc *sc);
void
ath5k_debug_finish_device(struct ath5k_softc *sc);
void void
ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah); ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah);
...@@ -166,9 +152,6 @@ ATH5K_DBG_UNLIMIT(struct ath5k_softc *sc, unsigned int m, const char *fmt, ...) ...@@ -166,9 +152,6 @@ ATH5K_DBG_UNLIMIT(struct ath5k_softc *sc, unsigned int m, const char *fmt, ...)
static inline void static inline void
ath5k_debug_init_device(struct ath5k_softc *sc) {} ath5k_debug_init_device(struct ath5k_softc *sc) {}
static inline void
ath5k_debug_finish_device(struct ath5k_softc *sc) {}
static inline void static inline void
ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah) {} ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah) {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment