提交 653ea7a6 编写于 作者: E Emmanuel Grumbach 提交者: Johannes Berg

iwlwifi: don't treat a bool as an error code

iwl_trans_grab_nic_access returns a boolean. So ret should
explicitely set to an error code and not rely on the value
returned by iwl_trans_grab_nic_access.
Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 4fd442db
...@@ -459,11 +459,11 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw) ...@@ -459,11 +459,11 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
base = priv->device_pointers.error_event_table; base = priv->device_pointers.error_event_table;
if (iwlagn_hw_valid_rtc_data_addr(base)) { if (iwlagn_hw_valid_rtc_data_addr(base)) {
spin_lock_irqsave(&priv->trans->reg_lock, flags); spin_lock_irqsave(&priv->trans->reg_lock, flags);
ret = iwl_trans_grab_nic_access(priv->trans, true); if (iwl_trans_grab_nic_access(priv->trans, true)) {
if (likely(ret == 0)) {
iwl_write32(priv->trans, HBUS_TARG_MEM_RADDR, base); iwl_write32(priv->trans, HBUS_TARG_MEM_RADDR, base);
status = iwl_read32(priv->trans, HBUS_TARG_MEM_RDAT); status = iwl_read32(priv->trans, HBUS_TARG_MEM_RDAT);
iwl_trans_release_nic_access(priv->trans); iwl_trans_release_nic_access(priv->trans);
ret = 0;
} }
spin_unlock_irqrestore(&priv->trans->reg_lock, flags); spin_unlock_irqrestore(&priv->trans->reg_lock, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册