aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index c01ea48da5f..129e2d330ab 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3868,7 +3868,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3868 } 3868 }
3869 err = iwl_eeprom_check_version(priv); 3869 err = iwl_eeprom_check_version(priv);
3870 if (err) 3870 if (err)
3871 goto out_iounmap; 3871 goto out_free_eeprom;
3872 3872
3873 /* extract MAC Address */ 3873 /* extract MAC Address */
3874 iwl_eeprom_get_mac(priv, priv->mac_addr); 3874 iwl_eeprom_get_mac(priv, priv->mac_addr);
@@ -3945,6 +3945,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3945 return 0; 3945 return 0;
3946 3946
3947 out_remove_sysfs: 3947 out_remove_sysfs:
3948 destroy_workqueue(priv->workqueue);
3949 priv->workqueue = NULL;
3948 sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group); 3950 sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group);
3949 out_uninit_drv: 3951 out_uninit_drv:
3950 iwl_uninit_drv(priv); 3952 iwl_uninit_drv(priv);
@@ -3953,8 +3955,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3953 out_iounmap: 3955 out_iounmap:
3954 pci_iounmap(pdev, priv->hw_base); 3956 pci_iounmap(pdev, priv->hw_base);
3955 out_pci_release_regions: 3957 out_pci_release_regions:
3956 pci_release_regions(pdev);
3957 pci_set_drvdata(pdev, NULL); 3958 pci_set_drvdata(pdev, NULL);
3959 pci_release_regions(pdev);
3958 out_pci_disable_device: 3960 out_pci_disable_device:
3959 pci_disable_device(pdev); 3961 pci_disable_device(pdev);
3960 out_ieee80211_free_hw: 3962 out_ieee80211_free_hw:
@@ -4042,7 +4044,19 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
4042 priv->is_open = 1; 4044 priv->is_open = 1;
4043 } 4045 }
4044 4046
4045 pci_save_state(pdev); 4047 /* pci driver assumes state will be saved in this function.
4048 * pci state is saved and device disabled when interface is
4049 * stopped, so at this time pci device will always be disabled -
4050 * whether interface was started or not. saving pci state now will
4051 * cause saved state be that of a disabled device, which will cause
4052 * problems during resume in that we will end up with a disabled device.
4053 *
4054 * indicate that the current saved state (from when interface was
4055 * stopped) is valid. if interface was never up at time of suspend
4056 * then the saved state will still be valid as it was saved during
4057 * .probe. */
4058 pdev->state_saved = true;
4059
4046 pci_set_power_state(pdev, PCI_D3hot); 4060 pci_set_power_state(pdev, PCI_D3hot);
4047 4061
4048 return 0; 4062 return 0;
@@ -4053,7 +4067,6 @@ static int iwl_pci_resume(struct pci_dev *pdev)
4053 struct iwl_priv *priv = pci_get_drvdata(pdev); 4067 struct iwl_priv *priv = pci_get_drvdata(pdev);
4054 4068
4055 pci_set_power_state(pdev, PCI_D0); 4069 pci_set_power_state(pdev, PCI_D0);
4056 pci_restore_state(pdev);
4057 4070
4058 if (priv->is_open) 4071 if (priv->is_open)
4059 iwl_mac_start(priv->hw); 4072 iwl_mac_start(priv->hw);