diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 5b44d322b99f..57dd34e256d8 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -7911,7 +7911,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7911 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); | 7911 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); |
7912 | if (err < 0) { | 7912 | if (err < 0) { |
7913 | IWL_DEBUG_INFO("Failed to init the card\n"); | 7913 | IWL_DEBUG_INFO("Failed to init the card\n"); |
7914 | goto out_remove_sysfs; | 7914 | goto out_iounmap; |
7915 | } | 7915 | } |
7916 | 7916 | ||
7917 | /*********************** | 7917 | /*********************** |
@@ -7921,7 +7921,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7921 | err = iwl3945_eeprom_init(priv); | 7921 | err = iwl3945_eeprom_init(priv); |
7922 | if (err) { | 7922 | if (err) { |
7923 | IWL_ERROR("Unable to init EEPROM\n"); | 7923 | IWL_ERROR("Unable to init EEPROM\n"); |
7924 | goto out_remove_sysfs; | 7924 | goto out_iounmap; |
7925 | } | 7925 | } |
7926 | /* MAC Address location in EEPROM same for 3945/4965 */ | 7926 | /* MAC Address location in EEPROM same for 3945/4965 */ |
7927 | get_eeprom_mac(priv, priv->mac_addr); | 7927 | get_eeprom_mac(priv, priv->mac_addr); |
@@ -7975,7 +7975,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7975 | err = iwl3945_init_channel_map(priv); | 7975 | err = iwl3945_init_channel_map(priv); |
7976 | if (err) { | 7976 | if (err) { |
7977 | IWL_ERROR("initializing regulatory failed: %d\n", err); | 7977 | IWL_ERROR("initializing regulatory failed: %d\n", err); |
7978 | goto out_release_irq; | 7978 | goto out_unset_hw_setting; |
7979 | } | 7979 | } |
7980 | 7980 | ||
7981 | err = iwl3945_init_geos(priv); | 7981 | err = iwl3945_init_geos(priv); |
@@ -8045,25 +8045,22 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
8045 | return 0; | 8045 | return 0; |
8046 | 8046 | ||
8047 | out_remove_sysfs: | 8047 | out_remove_sysfs: |
8048 | destroy_workqueue(priv->workqueue); | ||
8049 | priv->workqueue = NULL; | ||
8048 | sysfs_remove_group(&pdev->dev.kobj, &iwl3945_attribute_group); | 8050 | sysfs_remove_group(&pdev->dev.kobj, &iwl3945_attribute_group); |
8049 | out_free_geos: | 8051 | out_free_geos: |
8050 | iwl3945_free_geos(priv); | 8052 | iwl3945_free_geos(priv); |
8051 | out_free_channel_map: | 8053 | out_free_channel_map: |
8052 | iwl3945_free_channel_map(priv); | 8054 | iwl3945_free_channel_map(priv); |
8053 | 8055 | out_unset_hw_setting: | |
8054 | |||
8055 | out_release_irq: | ||
8056 | destroy_workqueue(priv->workqueue); | ||
8057 | priv->workqueue = NULL; | ||
8058 | iwl3945_unset_hw_setting(priv); | 8056 | iwl3945_unset_hw_setting(priv); |
8059 | |||
8060 | out_iounmap: | 8057 | out_iounmap: |
8061 | pci_iounmap(pdev, priv->hw_base); | 8058 | pci_iounmap(pdev, priv->hw_base); |
8062 | out_pci_release_regions: | 8059 | out_pci_release_regions: |
8063 | pci_release_regions(pdev); | 8060 | pci_release_regions(pdev); |
8064 | out_pci_disable_device: | 8061 | out_pci_disable_device: |
8065 | pci_disable_device(pdev); | ||
8066 | pci_set_drvdata(pdev, NULL); | 8062 | pci_set_drvdata(pdev, NULL); |
8063 | pci_disable_device(pdev); | ||
8067 | out_ieee80211_free_hw: | 8064 | out_ieee80211_free_hw: |
8068 | ieee80211_free_hw(priv->hw); | 8065 | ieee80211_free_hw(priv->hw); |
8069 | out: | 8066 | out: |
@@ -8143,7 +8140,19 @@ static int iwl3945_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
8143 | priv->is_open = 1; | 8140 | priv->is_open = 1; |
8144 | } | 8141 | } |
8145 | 8142 | ||
8146 | pci_save_state(pdev); | 8143 | /* pci driver assumes state will be saved in this function. |
8144 | * pci state is saved and device disabled when interface is | ||
8145 | * stopped, so at this time pci device will always be disabled - | ||
8146 | * whether interface was started or not. saving pci state now will | ||
8147 | * cause saved state be that of a disabled device, which will cause | ||
8148 | * problems during resume in that we will end up with a disabled device. | ||
8149 | * | ||
8150 | * indicate that the current saved state (from when interface was | ||
8151 | * stopped) is valid. if interface was never up at time of suspend | ||
8152 | * then the saved state will still be valid as it was saved during | ||
8153 | * .probe. */ | ||
8154 | pdev->state_saved = true; | ||
8155 | |||
8147 | pci_set_power_state(pdev, PCI_D3hot); | 8156 | pci_set_power_state(pdev, PCI_D3hot); |
8148 | 8157 | ||
8149 | return 0; | 8158 | return 0; |
@@ -8154,7 +8163,6 @@ static int iwl3945_pci_resume(struct pci_dev *pdev) | |||
8154 | struct iwl3945_priv *priv = pci_get_drvdata(pdev); | 8163 | struct iwl3945_priv *priv = pci_get_drvdata(pdev); |
8155 | 8164 | ||
8156 | pci_set_power_state(pdev, PCI_D0); | 8165 | pci_set_power_state(pdev, PCI_D0); |
8157 | pci_restore_state(pdev); | ||
8158 | 8166 | ||
8159 | if (priv->is_open) | 8167 | if (priv->is_open) |
8160 | iwl3945_mac_start(priv->hw); | 8168 | iwl3945_mac_start(priv->hw); |