diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-05-11 11:23:00 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-05-12 16:39:06 -0400 |
commit | c8a72c00c6a58186c35901c5fb15584ebc2a081d (patch) | |
tree | 06ae8652265865fa295ad59ff70bf2605fe66013 | |
parent | 8116daf2146d8fbc5d8d925984b3d4fd34dba1b4 (diff) |
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>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 55 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.h | 7 |
2 files changed, 16 insertions, 46 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index ab59e2ec18c6..59252ce24d7f 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -721,52 +721,36 @@ int ath9k_init_debug(struct ath_hw *ah) | |||
721 | sc->debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy), | 721 | sc->debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy), |
722 | ath9k_debugfs_root); | 722 | ath9k_debugfs_root); |
723 | if (!sc->debug.debugfs_phy) | 723 | if (!sc->debug.debugfs_phy) |
724 | goto err; | 724 | return -ENOMEM; |
725 | 725 | ||
726 | #ifdef CONFIG_ATH_DEBUG | 726 | #ifdef CONFIG_ATH_DEBUG |
727 | sc->debug.debugfs_debug = debugfs_create_file("debug", | 727 | if (!debugfs_create_file("debug", S_IRUSR | S_IWUSR, |
728 | S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc, &fops_debug); | 728 | sc->debug.debugfs_phy, sc, &fops_debug)) |
729 | if (!sc->debug.debugfs_debug) | ||
730 | goto err; | 729 | goto err; |
731 | #endif | 730 | #endif |
732 | 731 | ||
733 | sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUSR, | 732 | if (!debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, |
734 | sc->debug.debugfs_phy, sc, &fops_dma); | 733 | sc, &fops_dma)) |
735 | if (!sc->debug.debugfs_dma) | ||
736 | goto err; | 734 | goto err; |
737 | 735 | ||
738 | sc->debug.debugfs_interrupt = debugfs_create_file("interrupt", | 736 | if (!debugfs_create_file("interrupt", S_IRUSR, sc->debug.debugfs_phy, |
739 | S_IRUSR, | 737 | sc, &fops_interrupt)) |
740 | sc->debug.debugfs_phy, | ||
741 | sc, &fops_interrupt); | ||
742 | if (!sc->debug.debugfs_interrupt) | ||
743 | goto err; | 738 | goto err; |
744 | 739 | ||
745 | sc->debug.debugfs_rcstat = debugfs_create_file("rcstat", | 740 | if (!debugfs_create_file("rcstat", S_IRUSR, sc->debug.debugfs_phy, |
746 | S_IRUSR, | 741 | sc, &fops_rcstat)) |
747 | sc->debug.debugfs_phy, | ||
748 | sc, &fops_rcstat); | ||
749 | if (!sc->debug.debugfs_rcstat) | ||
750 | goto err; | 742 | goto err; |
751 | 743 | ||
752 | sc->debug.debugfs_wiphy = debugfs_create_file( | 744 | if (!debugfs_create_file("wiphy", S_IRUSR | S_IWUSR, |
753 | "wiphy", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc, | 745 | sc->debug.debugfs_phy, sc, &fops_wiphy)) |
754 | &fops_wiphy); | ||
755 | if (!sc->debug.debugfs_wiphy) | ||
756 | goto err; | 746 | goto err; |
757 | 747 | ||
758 | sc->debug.debugfs_xmit = debugfs_create_file("xmit", | 748 | if (!debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, |
759 | S_IRUSR, | 749 | sc, &fops_xmit)) |
760 | sc->debug.debugfs_phy, | ||
761 | sc, &fops_xmit); | ||
762 | if (!sc->debug.debugfs_xmit) | ||
763 | goto err; | 750 | goto err; |
764 | 751 | ||
765 | sc->debug.debugfs_recv = debugfs_create_file("recv", | 752 | if (!debugfs_create_file("recv", S_IRUSR, sc->debug.debugfs_phy, |
766 | S_IRUSR, | 753 | sc, &fops_recv)) |
767 | sc->debug.debugfs_phy, | ||
768 | sc, &fops_recv); | ||
769 | if (!sc->debug.debugfs_recv) | ||
770 | goto err; | 754 | goto err; |
771 | 755 | ||
772 | return 0; | 756 | return 0; |
@@ -780,14 +764,7 @@ void ath9k_exit_debug(struct ath_hw *ah) | |||
780 | struct ath_common *common = ath9k_hw_common(ah); | 764 | struct ath_common *common = ath9k_hw_common(ah); |
781 | struct ath_softc *sc = (struct ath_softc *) common->priv; | 765 | struct ath_softc *sc = (struct ath_softc *) common->priv; |
782 | 766 | ||
783 | debugfs_remove(sc->debug.debugfs_recv); | 767 | debugfs_remove_recursive(sc->debug.debugfs_phy); |
784 | debugfs_remove(sc->debug.debugfs_xmit); | ||
785 | debugfs_remove(sc->debug.debugfs_wiphy); | ||
786 | debugfs_remove(sc->debug.debugfs_rcstat); | ||
787 | debugfs_remove(sc->debug.debugfs_interrupt); | ||
788 | debugfs_remove(sc->debug.debugfs_dma); | ||
789 | debugfs_remove(sc->debug.debugfs_debug); | ||
790 | debugfs_remove(sc->debug.debugfs_phy); | ||
791 | } | 768 | } |
792 | 769 | ||
793 | int ath9k_debug_create_root(void) | 770 | int ath9k_debug_create_root(void) |
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h index c545960e7ec5..731436035bac 100644 --- a/drivers/net/wireless/ath/ath9k/debug.h +++ b/drivers/net/wireless/ath/ath9k/debug.h | |||
@@ -153,13 +153,6 @@ struct ath_stats { | |||
153 | 153 | ||
154 | struct ath9k_debug { | 154 | struct ath9k_debug { |
155 | struct dentry *debugfs_phy; | 155 | struct dentry *debugfs_phy; |
156 | struct dentry *debugfs_debug; | ||
157 | struct dentry *debugfs_dma; | ||
158 | struct dentry *debugfs_interrupt; | ||
159 | struct dentry *debugfs_rcstat; | ||
160 | struct dentry *debugfs_wiphy; | ||
161 | struct dentry *debugfs_xmit; | ||
162 | struct dentry *debugfs_recv; | ||
163 | struct ath_stats stats; | 156 | struct ath_stats stats; |
164 | }; | 157 | }; |
165 | 158 | ||