aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl4965-base.c
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2008-03-28 19:21:09 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-01 17:13:19 -0400
commit897e1cf29e05e3373bf380a417d085cd3389a3c0 (patch)
tree8e60c677284c649ebcfaabf727da1ec607adba7c /drivers/net/wireless/iwlwifi/iwl4965-base.c
parent0359facc7b7a37fd1223ac60649c80cd8daeaf73 (diff)
iwlwifi: move rate registration to module load
Having rate registration during module load enables the use of error checking as well as reliable registration/unregistration pairing. Previously this was not possible as rate registration was done during _probe where _probe could be run for more than one device on the system. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 29e843108e9f..ae4e53f5bedd 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -8243,7 +8243,6 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev)
8243 8243
8244 if (priv->mac80211_registered) { 8244 if (priv->mac80211_registered) {
8245 ieee80211_unregister_hw(priv->hw); 8245 ieee80211_unregister_hw(priv->hw);
8246 iwl4965_rate_control_unregister(priv->hw);
8247 } 8246 }
8248 8247
8249 /*netif_stop_queue(dev); */ 8248 /*netif_stop_queue(dev); */
@@ -8324,21 +8323,35 @@ static int __init iwl4965_init(void)
8324 int ret; 8323 int ret;
8325 printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n"); 8324 printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n");
8326 printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n"); 8325 printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n");
8326
8327 ret = iwl4965_rate_control_register();
8328 if (ret) {
8329 IWL_ERROR("Unable to register rate control algorithm: %d\n", ret);
8330 return ret;
8331 }
8332
8327 ret = pci_register_driver(&iwl4965_driver); 8333 ret = pci_register_driver(&iwl4965_driver);
8328 if (ret) { 8334 if (ret) {
8329 IWL_ERROR("Unable to initialize PCI module\n"); 8335 IWL_ERROR("Unable to initialize PCI module\n");
8330 return ret; 8336 goto error_register;
8331 } 8337 }
8332#ifdef CONFIG_IWLWIFI_DEBUG 8338#ifdef CONFIG_IWLWIFI_DEBUG
8333 ret = driver_create_file(&iwl4965_driver.driver, &driver_attr_debug_level); 8339 ret = driver_create_file(&iwl4965_driver.driver, &driver_attr_debug_level);
8334 if (ret) { 8340 if (ret) {
8335 IWL_ERROR("Unable to create driver sysfs file\n"); 8341 IWL_ERROR("Unable to create driver sysfs file\n");
8336 pci_unregister_driver(&iwl4965_driver); 8342 goto error_debug;
8337 return ret;
8338 } 8343 }
8339#endif 8344#endif
8340 8345
8341 return ret; 8346 return ret;
8347
8348#ifdef CONFIG_IWLWIFI_DEBUG
8349error_debug:
8350 pci_unregister_driver(&iwl4965_driver);
8351#endif
8352error_register:
8353 iwl4965_rate_control_unregister();
8354 return ret;
8342} 8355}
8343 8356
8344static void __exit iwl4965_exit(void) 8357static void __exit iwl4965_exit(void)
@@ -8347,6 +8360,7 @@ static void __exit iwl4965_exit(void)
8347 driver_remove_file(&iwl4965_driver.driver, &driver_attr_debug_level); 8360 driver_remove_file(&iwl4965_driver.driver, &driver_attr_debug_level);
8348#endif 8361#endif
8349 pci_unregister_driver(&iwl4965_driver); 8362 pci_unregister_driver(&iwl4965_driver);
8363 iwl4965_rate_control_unregister();
8350} 8364}
8351 8365
8352module_exit(iwl4965_exit); 8366module_exit(iwl4965_exit);