diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-08-06 23:39:14 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-25 00:28:19 +0400 |
commit | 6ddbf8cd39dc1faee7ba60337b11eb02edfcbee6 (patch) | |
tree | 761047539493edb772774caaf582ec443e4af9ac /drivers/net/wireless/iwlwifi/iwl-power.c | |
parent | 2b2d7795371df85bb106513d1b5fec077a29176e (diff) | |
download | linux-6ddbf8cd39dc1faee7ba60337b11eb02edfcbee6.tar.xz |
iwlwifi: fix thermal throttling related power management operation
The current approach is very broken because it adds an
often-used code path that will not initialise "cmd" at all.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Shanyu Zhao <shanyu.zhao.intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@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.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index da1f2ae24472..63c0ab46261f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c @@ -284,13 +284,11 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force) priv->hw->conf.flags & IEEE80211_CONF_IDLE) iwl_static_sleep_cmd(priv, &cmd, IWL_POWER_INDEX_5, 20); else if (priv->cfg->ops->lib->tt_ops.lower_power_detection && - priv->cfg->ops->lib->tt_ops.tt_power_mode) { - if (priv->cfg->ops->lib->tt_ops.lower_power_detection(priv)) { - /* in thermal throttling low power state */ - iwl_static_sleep_cmd(priv, &cmd, - priv->cfg->ops->lib->tt_ops.tt_power_mode(priv), - dtimper); - } + priv->cfg->ops->lib->tt_ops.tt_power_mode && + priv->cfg->ops->lib->tt_ops.lower_power_detection(priv)) { + /* in thermal throttling low power state */ + iwl_static_sleep_cmd(priv, &cmd, + priv->cfg->ops->lib->tt_ops.tt_power_mode(priv), dtimper); } else if (!enabled) iwl_power_sleep_cam_cmd(priv, &cmd); else if (priv->power_data.debug_sleep_level_override >= 0) |