aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl4965-base.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-05-15 01:54:17 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:48:06 -0400
commit6ba879562289bcad537a2374754ef750307c7d32 (patch)
treecdfe183883a2ab093419dd7c6544ea76877f3572 /drivers/net/wireless/iwlwifi/iwl4965-base.c
parent445c2dff409ef9de5d2f964d20917ab238fd266f (diff)
iwlwifi: refactor pci prob flow
This patch refactores pci prob flow. It moves mac80211 registration to the end, otherwise there is a race between error path in pci_probe and mac_start. 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.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index e06142d9da59..05edde178302 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -5878,10 +5878,10 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
5878 } 5878 }
5879 5879
5880 /******************* 5880 /*******************
5881 * 6. Setup hw/priv 5881 * 6. Setup priv
5882 *******************/ 5882 *******************/
5883 5883
5884 err = iwl_setup(priv); 5884 err = iwl_init_drv(priv);
5885 if (err) 5885 if (err)
5886 goto out_free_eeprom; 5886 goto out_free_eeprom;
5887 /* At this point both hw and priv are initialized. */ 5887 /* At this point both hw and priv are initialized. */
@@ -5896,9 +5896,6 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
5896 IWL_DEBUG_INFO("Radio disabled.\n"); 5896 IWL_DEBUG_INFO("Radio disabled.\n");
5897 } 5897 }
5898 5898
5899 if (priv->cfg->mod_params->enable_qos)
5900 priv->qos_data.qos_enable = 1;
5901
5902 /******************** 5899 /********************
5903 * 8. Setup services 5900 * 8. Setup services
5904 ********************/ 5901 ********************/
@@ -5909,14 +5906,9 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
5909 err = sysfs_create_group(&pdev->dev.kobj, &iwl4965_attribute_group); 5906 err = sysfs_create_group(&pdev->dev.kobj, &iwl4965_attribute_group);
5910 if (err) { 5907 if (err) {
5911 IWL_ERROR("failed to create sysfs device attributes\n"); 5908 IWL_ERROR("failed to create sysfs device attributes\n");
5912 goto out_free_eeprom; 5909 goto out_uninit_drv;
5913 } 5910 }
5914 5911
5915 err = iwl_dbgfs_register(priv, DRV_NAME);
5916 if (err) {
5917 IWL_ERROR("failed to create debugfs files\n");
5918 goto out_remove_sysfs;
5919 }
5920 5912
5921 iwl4965_setup_deferred_work(priv); 5913 iwl4965_setup_deferred_work(priv);
5922 iwl4965_setup_rx_handlers(priv); 5914 iwl4965_setup_rx_handlers(priv);
@@ -5927,12 +5919,26 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
5927 pci_save_state(pdev); 5919 pci_save_state(pdev);
5928 pci_disable_device(pdev); 5920 pci_disable_device(pdev);
5929 5921
5922 /**********************************
5923 * 10. Setup and register mac80211
5924 **********************************/
5925
5926 err = iwl_setup_mac(priv);
5927 if (err)
5928 goto out_remove_sysfs;
5929
5930 err = iwl_dbgfs_register(priv, DRV_NAME);
5931 if (err)
5932 IWL_ERROR("failed to create debugfs files\n");
5933
5930 /* notify iwlcore to init */ 5934 /* notify iwlcore to init */
5931 iwlcore_low_level_notify(priv, IWLCORE_INIT_EVT); 5935 iwlcore_low_level_notify(priv, IWLCORE_INIT_EVT);
5932 return 0; 5936 return 0;
5933 5937
5934 out_remove_sysfs: 5938 out_remove_sysfs:
5935 sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group); 5939 sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group);
5940 out_uninit_drv:
5941 iwl_uninit_drv(priv);
5936 out_free_eeprom: 5942 out_free_eeprom:
5937 iwl_eeprom_free(priv); 5943 iwl_eeprom_free(priv);
5938 out_iounmap: 5944 out_iounmap:
@@ -6014,8 +6020,7 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev)
6014 pci_disable_device(pdev); 6020 pci_disable_device(pdev);
6015 pci_set_drvdata(pdev, NULL); 6021 pci_set_drvdata(pdev, NULL);
6016 6022
6017 iwl_free_channel_map(priv); 6023 iwl_uninit_drv(priv);
6018 iwlcore_free_geos(priv);
6019 6024
6020 if (priv->ibss_beacon) 6025 if (priv->ibss_beacon)
6021 dev_kfree_skb(priv->ibss_beacon); 6026 dev_kfree_skb(priv->ibss_beacon);