aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/debug.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c55
1 files changed, 16 insertions, 39 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
793int ath9k_debug_create_root(void) 770int ath9k_debug_create_root(void)