diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-power.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-power.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index 07a5f60e9229..b429daa5a2bc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c | |||
@@ -257,15 +257,11 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force) | |||
257 | struct iwl_power_mgr *setting = &(priv->power_data); | 257 | struct iwl_power_mgr *setting = &(priv->power_data); |
258 | int ret = 0; | 258 | int ret = 0; |
259 | u16 uninitialized_var(final_mode); | 259 | u16 uninitialized_var(final_mode); |
260 | bool update_chains; | ||
260 | 261 | ||
261 | /* Don't update the RX chain when chain noise calibration is running */ | 262 | /* Don't update the RX chain when chain noise calibration is running */ |
262 | if (priv->chain_noise_data.state != IWL_CHAIN_NOISE_DONE && | 263 | update_chains = priv->chain_noise_data.state == IWL_CHAIN_NOISE_DONE || |
263 | priv->chain_noise_data.state != IWL_CHAIN_NOISE_ALIVE) { | 264 | priv->chain_noise_data.state == IWL_CHAIN_NOISE_ALIVE; |
264 | IWL_DEBUG_POWER("Cannot update the power, chain noise " | ||
265 | "calibration running: %d\n", | ||
266 | priv->chain_noise_data.state); | ||
267 | return -EAGAIN; | ||
268 | } | ||
269 | 265 | ||
270 | /* If on battery, set to 3, | 266 | /* If on battery, set to 3, |
271 | * if plugged into AC power, set to CAM ("continuously aware mode"), | 267 | * if plugged into AC power, set to CAM ("continuously aware mode"), |
@@ -313,9 +309,12 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force) | |||
313 | else | 309 | else |
314 | set_bit(STATUS_POWER_PMI, &priv->status); | 310 | set_bit(STATUS_POWER_PMI, &priv->status); |
315 | 311 | ||
316 | if (priv->cfg->ops->lib->update_chain_flags) | 312 | if (priv->cfg->ops->lib->update_chain_flags && update_chains) |
317 | priv->cfg->ops->lib->update_chain_flags(priv); | 313 | priv->cfg->ops->lib->update_chain_flags(priv); |
318 | 314 | else | |
315 | IWL_DEBUG_POWER("Cannot update the power, chain noise " | ||
316 | "calibration running: %d\n", | ||
317 | priv->chain_noise_data.state); | ||
319 | if (!ret) | 318 | if (!ret) |
320 | setting->power_mode = final_mode; | 319 | setting->power_mode = final_mode; |
321 | } | 320 | } |