iwl3945: release resources before shutting down
authorKolekar, Abhijeet <abhijeet.kolekar@intel.com>
Fri, 19 Dec 2008 02:37:41 +0000 (10:37 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 Jan 2009 20:59:22 +0000 (15:59 -0500)
Release resource before shutting down and notify upper stack.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl3945-base.c

index b84509763ac71e889642c490adae065b00d51656..17f01a69287045812e12b157be9f1950d5d3f1ea 100644 (file)
@@ -7722,7 +7722,12 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
 
        set_bit(STATUS_EXIT_PENDING, &priv->status);
 
-       iwl3945_down(priv);
+       if (priv->mac80211_registered) {
+               ieee80211_unregister_hw(priv->hw);
+               priv->mac80211_registered = 0;
+       } else {
+               iwl3945_down(priv);
+       }
 
        /* make sure we flush any pending irq or
         * tasklet for the driver
@@ -7745,9 +7750,6 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
        iwl3945_unset_hw_params(priv);
        iwl3945_clear_stations_table(priv);
 
-       if (priv->mac80211_registered)
-               ieee80211_unregister_hw(priv->hw);
-
        /*netif_stop_queue(dev); */
        flush_workqueue(priv->workqueue);