summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/iwl-power.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-08-08 02:41:47 +0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 17:13:49 +0400
commit3a780d25428a0a391a8ba6c888cf4e89ac3fdbb1 (patch)
tree582df70a3253fff3164e94052900d75af55c5d96 /drivers/net/wireless/iwlwifi/iwl-power.c
parentee9f29894fc3819c1bd639fc3a886326bb809266 (diff)
downloadlinux-3a780d25428a0a391a8ba6c888cf4e89ac3fdbb1.tar.xz
iwlwifi: handle the case when set power fail
Modify the power update function, when driver fail to set the power, it should not continue move forward and try to change the rx chain configuration. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-power.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-power.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index bd97a0da1cd5..9e8916d15ecf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -282,18 +282,21 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
cmd.flags |= IWL_POWER_FAST_PD;
ret = iwl_set_power(priv, &cmd);
-
- if (final_mode == IWL_POWER_MODE_CAM)
- clear_bit(STATUS_POWER_PMI, &priv->status);
-
- if (priv->cfg->ops->lib->update_chain_flags && update_chains)
- priv->cfg->ops->lib->update_chain_flags(priv);
- else
- IWL_DEBUG_POWER(priv, "Cannot update the power, chain noise "
+ if (!ret) {
+ if (final_mode == IWL_POWER_MODE_CAM)
+ clear_bit(STATUS_POWER_PMI, &priv->status);
+
+ if (priv->cfg->ops->lib->update_chain_flags &&
+ update_chains)
+ priv->cfg->ops->lib->update_chain_flags(priv);
+ else
+ IWL_DEBUG_POWER(priv,
+ "Cannot update the power, chain noise "
"calibration running: %d\n",
priv->chain_noise_data.state);
- if (!ret)
setting->power_mode = final_mode;
+ } else
+ IWL_ERR(priv, "set power fail, ret = %d", ret);
}
return ret;