iwlwifi: call apm stop on exit
authorGregory Greenman <gregory.greenman@intel.com>
Wed, 3 Sep 2008 03:18:49 +0000 (11:18 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 3 Sep 2008 19:10:37 +0000 (15:10 -0400)
This patch calls apm stop on exit and suspend. Without this patch
hardware consumes power even after driver is removed or suspended.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-agn.c

index 34928c8ed2020972249b790478d660019d92d1c5..4e3d6c7fd6dec1a44d0702f27bfd7f7df4d1d59f 100644 (file)
@@ -2187,7 +2187,10 @@ static void __iwl4965_down(struct iwl_priv *priv)
        udelay(5);
 
        /* FIXME: apm_ops.suspend(priv) */
-       priv->cfg->ops->lib->apm_ops.reset(priv);
+       if (exit_pending || test_bit(STATUS_IN_SUSPEND, &priv->status))
+               priv->cfg->ops->lib->apm_ops.stop(priv);
+       else
+               priv->cfg->ops->lib->apm_ops.reset(priv);
        priv->cfg->ops->lib->free_shared_mem(priv);
 
  exit: