ath9k: create a common debugfs_root for all device instances

The driver are trying to create an 'ath9k' directory in debugfs for each
device currently. If there are more than one device in the system, the
second try will always fail.

Changes-licensed-under: ISC

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index f473fee..bb30ccc 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -2858,12 +2858,20 @@
 		goto err_out;
 	}
 
+	error = ath9k_debug_create_root();
+	if (error) {
+		printk(KERN_ERR
+			"ath9k: Unable to create debugfs root: %d\n",
+			error);
+		goto err_rate_unregister;
+	}
+
 	error = ath_pci_init();
 	if (error < 0) {
 		printk(KERN_ERR
 			"ath9k: No PCI devices found, driver not installed.\n");
 		error = -ENODEV;
-		goto err_rate_unregister;
+		goto err_remove_root;
 	}
 
 	error = ath_ahb_init();
@@ -2877,6 +2885,8 @@
  err_pci_exit:
 	ath_pci_exit();
 
+ err_remove_root:
+	ath9k_debug_remove_root();
  err_rate_unregister:
 	ath_rate_control_unregister();
  err_out:
@@ -2888,6 +2898,7 @@
 {
 	ath_ahb_exit();
 	ath_pci_exit();
+	ath9k_debug_remove_root();
 	ath_rate_control_unregister();
 	printk(KERN_INFO "%s: Driver unloaded\n", dev_info);
 }