Commit 78e5a464 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Wey-Yi Guy

iwlwifi: kill iwl_down and s/__iwl_down/iwl_down

iwl_down was just a wrapper around __iwl_down which was called from
one place only. Replace it to direct call to iwl_down. Add lockdep
warning in iwl_down to ensure it was called with the mutex held.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 655ccceb
...@@ -738,14 +738,14 @@ int iwl_alive_start(struct iwl_priv *priv) ...@@ -738,14 +738,14 @@ int iwl_alive_start(struct iwl_priv *priv)
return iwl_power_update_mode(priv, true); return iwl_power_update_mode(priv, true);
} }
static void iwl_cancel_deferred_work(struct iwl_priv *priv); void iwl_down(struct iwl_priv *priv)
void __iwl_down(struct iwl_priv *priv)
{ {
int exit_pending; int exit_pending;
IWL_DEBUG_INFO(priv, DRV_NAME " is going down\n"); IWL_DEBUG_INFO(priv, DRV_NAME " is going down\n");
lockdep_assert_held(&priv->shrd->mutex);
iwl_scan_cancel_timeout(priv, 200); iwl_scan_cancel_timeout(priv, 200);
/* /*
...@@ -803,15 +803,6 @@ void __iwl_down(struct iwl_priv *priv) ...@@ -803,15 +803,6 @@ void __iwl_down(struct iwl_priv *priv)
priv->beacon_skb = NULL; priv->beacon_skb = NULL;
} }
void iwl_down(struct iwl_priv *priv)
{
mutex_lock(&priv->shrd->mutex);
__iwl_down(priv);
mutex_unlock(&priv->shrd->mutex);
iwl_cancel_deferred_work(priv);
}
/***************************************************************************** /*****************************************************************************
* *
* Workqueue callbacks * Workqueue callbacks
...@@ -869,7 +860,7 @@ void iwlagn_prepare_restart(struct iwl_priv *priv) ...@@ -869,7 +860,7 @@ void iwlagn_prepare_restart(struct iwl_priv *priv)
bt_status = priv->bt_status; bt_status = priv->bt_status;
bt_is_sco = priv->bt_is_sco; bt_is_sco = priv->bt_is_sco;
__iwl_down(priv); iwl_down(priv);
priv->bt_full_concurrent = bt_full_concurrent; priv->bt_full_concurrent = bt_full_concurrent;
priv->bt_ci_compliance = bt_ci_compliance; priv->bt_ci_compliance = bt_ci_compliance;
...@@ -970,7 +961,7 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv) ...@@ -970,7 +961,7 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)
priv->watchdog.function = iwl_bg_watchdog; priv->watchdog.function = iwl_bg_watchdog;
} }
static void iwl_cancel_deferred_work(struct iwl_priv *priv) void iwl_cancel_deferred_work(struct iwl_priv *priv)
{ {
if (cfg(priv)->lib->cancel_deferred_work) if (cfg(priv)->lib->cancel_deferred_work)
cfg(priv)->lib->cancel_deferred_work(priv); cfg(priv)->lib->cancel_deferred_work(priv);
......
...@@ -81,8 +81,8 @@ static inline void iwl_set_calib_hdr(struct iwl_calib_hdr *hdr, u8 cmd) ...@@ -81,8 +81,8 @@ static inline void iwl_set_calib_hdr(struct iwl_calib_hdr *hdr, u8 cmd)
hdr->data_valid = 1; hdr->data_valid = 1;
} }
void __iwl_down(struct iwl_priv *priv);
void iwl_down(struct iwl_priv *priv); void iwl_down(struct iwl_priv *priv);
void iwl_cancel_deferred_work(struct iwl_priv *priv);
void iwlagn_prepare_restart(struct iwl_priv *priv); void iwlagn_prepare_restart(struct iwl_priv *priv);
/* MAC80211 */ /* MAC80211 */
......
...@@ -296,7 +296,7 @@ static int __iwl_up(struct iwl_priv *priv) ...@@ -296,7 +296,7 @@ static int __iwl_up(struct iwl_priv *priv)
error: error:
set_bit(STATUS_EXIT_PENDING, &priv->shrd->status); set_bit(STATUS_EXIT_PENDING, &priv->shrd->status);
__iwl_down(priv); iwl_down(priv);
clear_bit(STATUS_EXIT_PENDING, &priv->shrd->status); clear_bit(STATUS_EXIT_PENDING, &priv->shrd->status);
IWL_ERR(priv, "Unable to initialize device.\n"); IWL_ERR(priv, "Unable to initialize device.\n");
...@@ -341,7 +341,11 @@ static void iwlagn_mac_stop(struct ieee80211_hw *hw) ...@@ -341,7 +341,11 @@ static void iwlagn_mac_stop(struct ieee80211_hw *hw)
priv->is_open = 0; priv->is_open = 0;
mutex_lock(&priv->shrd->mutex);
iwl_down(priv); iwl_down(priv);
mutex_unlock(&priv->shrd->mutex);
iwl_cancel_deferred_work(priv);
flush_workqueue(priv->workqueue); flush_workqueue(priv->workqueue);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment