diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2012-03-07 21:52:24 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-08 22:59:50 +0400 |
commit | bfe4b80e9f7385f34986736cdc094be56782109a (patch) | |
tree | 29b1335d3045834bcbb5d23d53a4b212ef9355e0 /drivers/net/wireless/iwlwifi/iwl-mac80211.c | |
parent | aa5affbacb24cb5d8fd6f7c66e57d62164ed6d34 (diff) | |
download | linux-bfe4b80e9f7385f34986736cdc094be56782109a.tar.xz |
iwlwifi: always check if got h/w access before write
Before we write to the device registers always check if
iwl_grap_nic_access() was successful.
On the way change return type of grab_nic_access() to bool, and add
likely()/unlikely() statement.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@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-mac80211.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-mac80211.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c index bdcbbd0d3467..91a42c3261aa 100644 --- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c +++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c @@ -445,7 +445,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw) if (iwlagn_hw_valid_rtc_data_addr(base)) { spin_lock_irqsave(&trans(priv)->reg_lock, flags); ret = iwl_grab_nic_access_silent(trans(priv)); - if (ret == 0) { + if (likely(ret == 0)) { iwl_write32(trans(priv), HBUS_TARG_MEM_RADDR, base); status = iwl_read32(trans(priv), HBUS_TARG_MEM_RDAT); iwl_release_nic_access(trans(priv)); |