aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-04-13 06:14:44 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-04-22 13:02:26 -0400
commit1a10f43313481b99154b3b1ce6863742475422e0 (patch)
tree156e5973b05c91a49e95119074077193244ad46b /drivers/net/wireless/iwlwifi/iwl-agn.c
parente46f6538c24f01bb68dc374358ce85a0af666682 (diff)
iwlagn: clean up some exit code
There's no point in running through iwl_down() when we never registered with mac80211, as it just cleans up internal structures that were never initialised in this case. Therefore we can also remove the special handling for this case from __iwl_down(). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index f8559cc974f8..2845f6372110 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2382,20 +2382,7 @@ static void __iwl_down(struct iwl_priv *priv)
2382 if (priv->mac80211_registered) 2382 if (priv->mac80211_registered)
2383 ieee80211_stop_queues(priv->hw); 2383 ieee80211_stop_queues(priv->hw);
2384 2384
2385 /* If we have not previously called iwl_init() then 2385 /* Clear out all status bits but a few that are stable across reset */
2386 * clear all bits but the RF Kill bit and return */
2387 if (!iwl_is_init(priv)) {
2388 priv->status = test_bit(STATUS_RF_KILL_HW, &priv->status) <<
2389 STATUS_RF_KILL_HW |
2390 test_bit(STATUS_GEO_CONFIGURED, &priv->status) <<
2391 STATUS_GEO_CONFIGURED |
2392 test_bit(STATUS_EXIT_PENDING, &priv->status) <<
2393 STATUS_EXIT_PENDING;
2394 goto exit;
2395 }
2396
2397 /* ...otherwise clear out all the status bits but the RF Kill
2398 * bit and continue taking the NIC down. */
2399 priv->status &= test_bit(STATUS_RF_KILL_HW, &priv->status) << 2386 priv->status &= test_bit(STATUS_RF_KILL_HW, &priv->status) <<
2400 STATUS_RF_KILL_HW | 2387 STATUS_RF_KILL_HW |
2401 test_bit(STATUS_GEO_CONFIGURED, &priv->status) << 2388 test_bit(STATUS_GEO_CONFIGURED, &priv->status) <<
@@ -2421,7 +2408,6 @@ static void __iwl_down(struct iwl_priv *priv)
2421 /* Stop the device, and put it in low power state */ 2408 /* Stop the device, and put it in low power state */
2422 iwl_apm_stop(priv); 2409 iwl_apm_stop(priv);
2423 2410
2424 exit:
2425 dev_kfree_skb(priv->beacon_skb); 2411 dev_kfree_skb(priv->beacon_skb);
2426 priv->beacon_skb = NULL; 2412 priv->beacon_skb = NULL;
2427 2413
@@ -4072,17 +4058,9 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
4072 if (priv->mac80211_registered) { 4058 if (priv->mac80211_registered) {
4073 ieee80211_unregister_hw(priv->hw); 4059 ieee80211_unregister_hw(priv->hw);
4074 priv->mac80211_registered = 0; 4060 priv->mac80211_registered = 0;
4075 } else {
4076 iwl_down(priv);
4077 } 4061 }
4078 4062
4079 /* 4063 /* Reset to low power before unloading driver. */
4080 * Make sure device is reset to low power before unloading driver.
4081 * This may be redundant with iwl_down(), but there are paths to
4082 * run iwl_down() without calling apm_ops.stop(), and there are
4083 * paths to avoid running iwl_down() at all before leaving driver.
4084 * This (inexpensive) call *makes sure* device is reset.
4085 */
4086 iwl_apm_stop(priv); 4064 iwl_apm_stop(priv);
4087 4065
4088 iwl_tt_exit(priv); 4066 iwl_tt_exit(priv);