sc->hw = hw;
        sc->pdev = pdev;
 
-       ath5k_debug_init_device(sc);
-
        /*
         * Mark the device as detached to avoid processing
         * interrupts until setup is complete.
                }
        }
 
+       ath5k_debug_init_device(sc);
 
        /* ready to process interrupts */
        __clear_bit(ATH_STAT_INVALID, sc->status);
 {
        int ret;
 
-       ath5k_debug_init();
-
        ret = pci_register_driver(&ath5k_pci_driver);
        if (ret) {
                printk(KERN_ERR "ath5k_pci: can't register pci driver\n");
 exit_ath5k_pci(void)
 {
        pci_unregister_driver(&ath5k_pci_driver);
-
-       ath5k_debug_finish();
 }
 
 module_init(init_ath5k_pci);
 
 #include "reg.h"
 #include "ani.h"
 
-static struct dentry *ath5k_global_debugfs;
-
 static int ath5k_debugfs_open(struct inode *inode, struct file *file)
 {
        file->private_data = inode->i_private;
 };
 
 
-/* init */
-
-void
-ath5k_debug_init(void)
-{
-       ath5k_global_debugfs = debugfs_create_dir("ath5k", NULL);
-}
-
 void
 ath5k_debug_init_device(struct ath5k_softc *sc)
 {
        sc->debug.level = ath5k_debug;
 
-       sc->debug.debugfs_phydir = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
-                               ath5k_global_debugfs);
+       sc->debug.debugfs_phydir = debugfs_create_dir("ath5k",
+                               sc->hw->wiphy->debugfsdir);
 
        sc->debug.debugfs_debug = debugfs_create_file("debug",
                                S_IWUSR | S_IRUSR,
                                &fops_queue);
 }
 
-void
-ath5k_debug_finish(void)
-{
-       debugfs_remove(ath5k_global_debugfs);
-}
-
 void
 ath5k_debug_finish_device(struct ath5k_softc *sc)
 {
 
                        __func__, __LINE__, ##__VA_ARGS__); \
        } while (0)
 
-void
-ath5k_debug_init(void);
-
 void
 ath5k_debug_init_device(struct ath5k_softc *sc);
 
-void
-ath5k_debug_finish(void);
-
 void
 ath5k_debug_finish_device(struct ath5k_softc *sc);
 
 ATH5K_DBG_UNLIMIT(struct ath5k_softc *sc, unsigned int m, const char *fmt, ...)
 {}
 
-static inline void
-ath5k_debug_init(void) {}
-
 static inline void
 ath5k_debug_init_device(struct ath5k_softc *sc) {}
 
-static inline void
-ath5k_debug_finish(void) {}
-
 static inline void
 ath5k_debug_finish_device(struct ath5k_softc *sc) {}