iwlwifi: create iwl_mac80211 unregister routine
authorDon Fry <donald.h.fry@intel.com>
Fri, 9 Dec 2011 18:07:38 +0000 (10:07 -0800)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 16 Dec 2011 15:23:48 +0000 (07:23 -0800)
The mac80211 setup_register operations are collected in one routine,
but the cleanup routines are not.  Create a routine for this.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-agn.h
drivers/net/wireless/iwlwifi/iwl-mac80211.c

index 5a9370d839ce5bf01ba79cb3e01723e887ecbb1f..f7e089d5807b82271a53e7ad7dc6d7ef1512de92 100644 (file)
@@ -1915,12 +1915,7 @@ void __devexit iwl_remove(struct iwl_priv * priv)
        set_bit(STATUS_EXIT_PENDING, &priv->shrd->status);
 
        iwl_testmode_cleanup(priv);
-       iwl_leds_exit(priv);
-
-       if (priv->mac80211_registered) {
-               ieee80211_unregister_hw(priv->hw);
-               priv->mac80211_registered = 0;
-       }
+       iwlagn_mac_unregister(priv);
 
        iwl_tt_exit(priv);
 
index 66bcd3e6ccfb585e3fccc115e3955cb8c609bc1e..2c5b6c4af3ce5604d992de271b4e543621686281 100644 (file)
@@ -91,6 +91,7 @@ void iwlagn_prepare_restart(struct iwl_priv *priv);
 struct ieee80211_hw *iwl_alloc_all(void);
 int iwlagn_mac_setup_register(struct iwl_priv *priv,
                              struct iwlagn_ucode_capabilities *capa);
+void iwlagn_mac_unregister(struct iwl_priv *priv);
 
 /* RXON */
 int iwlagn_set_pan_params(struct iwl_priv *priv);
index 8074c6eafab03944a938816faba18d98de2f8d53..412ff484e105223eb2fb646968d7793eb4ae7616 100644 (file)
@@ -245,6 +245,15 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
        return 0;
 }
 
+void iwlagn_mac_unregister(struct iwl_priv *priv)
+{
+       if (!priv->mac80211_registered)
+               return;
+       iwl_leds_exit(priv);
+       ieee80211_unregister_hw(priv->hw);
+       priv->mac80211_registered = 0;
+}
+
 static int __iwl_up(struct iwl_priv *priv)
 {
        struct iwl_rxon_context *ctx;