diff options
author | Lilach Edelstein <lilach.edelstein@intel.com> | 2013-01-16 11:34:49 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-01 11:27:22 +0100 |
commit | e56b04efc1f795da42cf1d9651b52a4a5bebd730 (patch) | |
tree | a9740ffd4d47ffb7b90507691a0a066c20f42a2d /drivers/net/wireless/iwlwifi/dvm/main.c | |
parent | e139dc4aebf52a9c88552963b9794fd1dff036f1 (diff) | |
download | talos-op-linux-e56b04efc1f795da42cf1d9651b52a4a5bebd730.tar.gz talos-op-linux-e56b04efc1f795da42cf1d9651b52a4a5bebd730.zip |
iwlwifi: move register access lock into transport
Move the reg_lock that protects HW register access
into the transport implementation. Locking is no
longer exposed, but handled internally in grab and
release NIC access. This simplifies the users.
Signed-off-by: Lilach Edelstein <lilach.edelstein@intel.com>
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/dvm/main.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/dvm/main.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c index f5f91644adaa..b9e3517652d6 100644 --- a/drivers/net/wireless/iwlwifi/dvm/main.c +++ b/drivers/net/wireless/iwlwifi/dvm/main.c @@ -353,11 +353,8 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base, ptr = base + (4 * sizeof(u32)) + (start_idx * 3 * sizeof(u32)); /* Make sure device is powered up for SRAM reads */ - spin_lock_irqsave(&priv->trans->reg_lock, reg_flags); - if (!iwl_trans_grab_nic_access(priv->trans, false)) { - spin_unlock_irqrestore(&priv->trans->reg_lock, reg_flags); + if (!iwl_trans_grab_nic_access(priv->trans, false, ®_flags)) return; - } /* Set starting address; reads will auto-increment */ iwl_write32(priv->trans, HBUS_TARG_MEM_RADDR, ptr); @@ -388,8 +385,7 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base, } } /* Allow device to power down */ - iwl_trans_release_nic_access(priv->trans); - spin_unlock_irqrestore(&priv->trans->reg_lock, reg_flags); + iwl_trans_release_nic_access(priv->trans, ®_flags); } static void iwl_continuous_event_trace(struct iwl_priv *priv) @@ -1717,9 +1713,8 @@ static int iwl_print_event_log(struct iwl_priv *priv, u32 start_idx, ptr = base + EVENT_START_OFFSET + (start_idx * event_size); /* Make sure device is powered up for SRAM reads */ - spin_lock_irqsave(&trans->reg_lock, reg_flags); - if (!iwl_trans_grab_nic_access(trans, false)) - goto out_unlock; + if (!iwl_trans_grab_nic_access(trans, false, ®_flags)) + return pos; /* Set starting address; reads will auto-increment */ iwl_write32(trans, HBUS_TARG_MEM_RADDR, ptr); @@ -1757,9 +1752,7 @@ static int iwl_print_event_log(struct iwl_priv *priv, u32 start_idx, } /* Allow device to power down */ - iwl_trans_release_nic_access(trans); -out_unlock: - spin_unlock_irqrestore(&trans->reg_lock, reg_flags); + iwl_trans_release_nic_access(trans, ®_flags); return pos; } |