From 19d8bc22bcea749da2ba065a1ff9e054fadb556e Mon Sep 17 00:00:00 2001
From: Gabor Juhos <juhosg@openwrt.org>
Date: Thu, 5 Mar 2009 16:55:18 +0100
Subject: 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>
---
 drivers/net/wireless/ath9k/main.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'drivers/net/wireless/ath9k/main.c')

diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index f473fee72a2e..bb30ccca1843 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -2858,12 +2858,20 @@ static int __init ath9k_init(void)
 		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 @@ static int __init ath9k_init(void)
  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 @@ static void __exit ath9k_exit(void)
 {
 	ath_ahb_exit();
 	ath_pci_exit();
+	ath9k_debug_remove_root();
 	ath_rate_control_unregister();
 	printk(KERN_INFO "%s: Driver unloaded\n", dev_info);
 }
-- 
cgit v1.2.3