summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2012-03-07 18:52:24 +0100
committerJohn W. Linville <linville@tuxdriver.com>2012-03-08 19:59:50 +0100
commitbfe4b80e9f7385f34986736cdc094be56782109a (patch)
tree29b1335d3045834bcbb5d23d53a4b212ef9355e0 /drivers/net/wireless/iwlwifi/iwl-agn-tt.c
parentiwlwifi: dump stack when fail to gain access to the device (diff)
downloadlinux-bfe4b80e9f7385f34986736cdc094be56782109a.tar.xz
linux-bfe4b80e9f7385f34986736cdc094be56782109a.zip
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-agn-tt.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tt.c b/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
index 7712c5537370..9a12b70c7d4f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
@@ -189,7 +189,7 @@ static void iwl_tt_check_exit_ct_kill(unsigned long data)
}
iwl_read32(trans(priv), CSR_UCODE_DRV_GP1);
spin_lock_irqsave(&trans(priv)->reg_lock, flags);
- if (!iwl_grab_nic_access(trans(priv)))
+ if (likely(iwl_grab_nic_access(trans(priv))))
iwl_release_nic_access(trans(priv));
spin_unlock_irqrestore(&trans(priv)->reg_lock, flags);