diff options
author | Emmanuel Grumbach | 2012-12-31 13:46:42 +0200 |
---|---|---|
committer | Johannes Berg | 2013-01-03 15:34:11 +0100 |
commit | abae2386d55aff1d395cdb665f03684c227a6a69 (patch) | |
tree | dfa4d78c306f6a17d7c6b170531b760c17055af4 /drivers/net/wireless/iwlwifi/iwl-trans.h | |
parent | c8f9b0feab564e1ecf460b440e838673aced282c (diff) |
iwlwifi: always check that grab_nic_access succeeds
This allows to let sparse check that the NIC access is
always released.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 7584d5522f15..b0d5c715ca1e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h @@ -734,15 +734,15 @@ static inline void iwl_trans_set_pmi(struct iwl_trans *trans, bool state) trans->ops->set_pmi(trans, state); } -static inline bool iwl_trans_grab_nic_access(struct iwl_trans *trans, - bool silent) -{ - return trans->ops->grab_nic_access(trans, silent); -} +#define iwl_trans_grab_nic_access(trans, silent) \ + __cond_lock(nic_access, \ + likely((trans)->ops->grab_nic_access(trans, silent))) -static inline void iwl_trans_release_nic_access(struct iwl_trans *trans) +static inline void __releases(nic_access) +iwl_trans_release_nic_access(struct iwl_trans *trans) { trans->ops->release_nic_access(trans); + __release(nic_access); } /***************************************************** |