diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-04-10 12:32:18 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-12 16:59:24 -0400 |
commit | 5b7916ad8c29da9f30fbf03a8b61862acdba00ce (patch) | |
tree | 217924ae5883a793e5bc8e36f01874d2530f0b0f | |
parent | ed8950857f728303a1463ac9267e72c278738bf6 (diff) |
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: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/debug.c | 65 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/debug.h | 17 |
3 files changed, 19 insertions, 64 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 1a561b89221e..a799d04e0c8c 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -2901,7 +2901,6 @@ ath5k_deinit_softc(struct ath5k_softc *sc) | |||
2901 | * XXX: ??? detach ath5k_hw ??? | 2901 | * XXX: ??? detach ath5k_hw ??? |
2902 | * Other than that, it's straightforward... | 2902 | * Other than that, it's straightforward... |
2903 | */ | 2903 | */ |
2904 | ath5k_debug_finish_device(sc); | ||
2905 | ieee80211_unregister_hw(hw); | 2904 | ieee80211_unregister_hw(hw); |
2906 | ath5k_desc_free(sc); | 2905 | ath5k_desc_free(sc); |
2907 | ath5k_txq_release(sc); | 2906 | ath5k_txq_release(sc); |
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c index 0230f30e9e9a..0bf7313b8a17 100644 --- a/drivers/net/wireless/ath/ath5k/debug.c +++ b/drivers/net/wireless/ath/ath5k/debug.c | |||
@@ -888,65 +888,38 @@ static const struct file_operations fops_queue = { | |||
888 | void | 888 | void |
889 | ath5k_debug_init_device(struct ath5k_softc *sc) | 889 | ath5k_debug_init_device(struct ath5k_softc *sc) |
890 | { | 890 | { |
891 | sc->debug.level = ath5k_debug; | 891 | struct dentry *phydir; |
892 | 892 | ||
893 | sc->debug.debugfs_phydir = debugfs_create_dir("ath5k", | 893 | sc->debug.level = ath5k_debug; |
894 | sc->hw->wiphy->debugfsdir); | ||
895 | 894 | ||
896 | sc->debug.debugfs_debug = debugfs_create_file("debug", | 895 | phydir = debugfs_create_dir("ath5k", sc->hw->wiphy->debugfsdir); |
897 | S_IWUSR | S_IRUSR, | 896 | if (!phydir) |
898 | sc->debug.debugfs_phydir, sc, &fops_debug); | 897 | return; |
899 | 898 | ||
900 | sc->debug.debugfs_registers = debugfs_create_file("registers", S_IRUSR, | 899 | debugfs_create_file("debug", S_IWUSR | S_IRUSR, phydir, sc, |
901 | sc->debug.debugfs_phydir, sc, &fops_registers); | 900 | &fops_debug); |
902 | 901 | ||
903 | sc->debug.debugfs_beacon = debugfs_create_file("beacon", | 902 | debugfs_create_file("registers", S_IRUSR, phydir, sc, &fops_registers); |
904 | S_IWUSR | S_IRUSR, | ||
905 | sc->debug.debugfs_phydir, sc, &fops_beacon); | ||
906 | 903 | ||
907 | sc->debug.debugfs_reset = debugfs_create_file("reset", S_IWUSR, | 904 | debugfs_create_file("beacon", S_IWUSR | S_IRUSR, phydir, sc, |
908 | sc->debug.debugfs_phydir, sc, &fops_reset); | 905 | &fops_beacon); |
909 | 906 | ||
910 | sc->debug.debugfs_antenna = debugfs_create_file("antenna", | 907 | debugfs_create_file("reset", S_IWUSR, phydir, sc, &fops_reset); |
911 | S_IWUSR | S_IRUSR, | ||
912 | sc->debug.debugfs_phydir, sc, &fops_antenna); | ||
913 | 908 | ||
914 | sc->debug.debugfs_misc = debugfs_create_file("misc", | 909 | debugfs_create_file("antenna", S_IWUSR | S_IRUSR, phydir, sc, |
915 | S_IRUSR, | 910 | &fops_antenna); |
916 | sc->debug.debugfs_phydir, sc, &fops_misc); | ||
917 | 911 | ||
918 | sc->debug.debugfs_frameerrors = debugfs_create_file("frameerrors", | 912 | debugfs_create_file("misc", S_IRUSR, phydir, sc, &fops_misc); |
919 | S_IWUSR | S_IRUSR, | ||
920 | sc->debug.debugfs_phydir, sc, | ||
921 | &fops_frameerrors); | ||
922 | 913 | ||
923 | sc->debug.debugfs_ani = debugfs_create_file("ani", | 914 | debugfs_create_file("frameerrors", S_IWUSR | S_IRUSR, phydir, sc, |
924 | S_IWUSR | S_IRUSR, | 915 | &fops_frameerrors); |
925 | sc->debug.debugfs_phydir, sc, | ||
926 | &fops_ani); | ||
927 | 916 | ||
928 | sc->debug.debugfs_queue = debugfs_create_file("queue", | 917 | debugfs_create_file("ani", S_IWUSR | S_IRUSR, phydir, sc, &fops_ani); |
929 | S_IWUSR | S_IRUSR, | ||
930 | sc->debug.debugfs_phydir, sc, | ||
931 | &fops_queue); | ||
932 | } | ||
933 | 918 | ||
934 | void | 919 | debugfs_create_file("queue", S_IWUSR | S_IRUSR, phydir, sc, |
935 | ath5k_debug_finish_device(struct ath5k_softc *sc) | 920 | &fops_queue); |
936 | { | ||
937 | debugfs_remove(sc->debug.debugfs_debug); | ||
938 | debugfs_remove(sc->debug.debugfs_registers); | ||
939 | debugfs_remove(sc->debug.debugfs_beacon); | ||
940 | debugfs_remove(sc->debug.debugfs_reset); | ||
941 | debugfs_remove(sc->debug.debugfs_antenna); | ||
942 | debugfs_remove(sc->debug.debugfs_misc); | ||
943 | debugfs_remove(sc->debug.debugfs_frameerrors); | ||
944 | debugfs_remove(sc->debug.debugfs_ani); | ||
945 | debugfs_remove(sc->debug.debugfs_queue); | ||
946 | debugfs_remove(sc->debug.debugfs_phydir); | ||
947 | } | 921 | } |
948 | 922 | ||
949 | |||
950 | /* functions used in other places */ | 923 | /* functions used in other places */ |
951 | 924 | ||
952 | void | 925 | void |
diff --git a/drivers/net/wireless/ath/ath5k/debug.h b/drivers/net/wireless/ath/ath5k/debug.h index b0355aef68d3..193dd2d4ea3c 100644 --- a/drivers/net/wireless/ath/ath5k/debug.h +++ b/drivers/net/wireless/ath/ath5k/debug.h | |||
@@ -68,17 +68,6 @@ struct ath5k_buf; | |||
68 | 68 | ||
69 | struct ath5k_dbg_info { | 69 | struct ath5k_dbg_info { |
70 | unsigned int level; /* debug level */ | 70 | unsigned int level; /* debug level */ |
71 | /* debugfs entries */ | ||
72 | struct dentry *debugfs_phydir; | ||
73 | struct dentry *debugfs_debug; | ||
74 | struct dentry *debugfs_registers; | ||
75 | struct dentry *debugfs_beacon; | ||
76 | struct dentry *debugfs_reset; | ||
77 | struct dentry *debugfs_antenna; | ||
78 | struct dentry *debugfs_misc; | ||
79 | struct dentry *debugfs_frameerrors; | ||
80 | struct dentry *debugfs_ani; | ||
81 | struct dentry *debugfs_queue; | ||
82 | }; | 71 | }; |
83 | 72 | ||
84 | /** | 73 | /** |
@@ -141,9 +130,6 @@ void | |||
141 | ath5k_debug_init_device(struct ath5k_softc *sc); | 130 | ath5k_debug_init_device(struct ath5k_softc *sc); |
142 | 131 | ||
143 | void | 132 | void |
144 | ath5k_debug_finish_device(struct ath5k_softc *sc); | ||
145 | |||
146 | void | ||
147 | ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah); | 133 | ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah); |
148 | 134 | ||
149 | void | 135 | void |
@@ -167,9 +153,6 @@ static inline void | |||
167 | ath5k_debug_init_device(struct ath5k_softc *sc) {} | 153 | ath5k_debug_init_device(struct ath5k_softc *sc) {} |
168 | 154 | ||
169 | static inline void | 155 | static inline void |
170 | ath5k_debug_finish_device(struct ath5k_softc *sc) {} | ||
171 | |||
172 | static inline void | ||
173 | ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah) {} | 156 | ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah) {} |
174 | 157 | ||
175 | static inline void | 158 | static inline void |