iwlwifi: remove bg_up work
authorJohannes Berg <johannes.berg@intel.com>
Thu, 21 Jan 2010 14:07:17 +0000 (06:07 -0800)
committerReinette Chatre <reinette.chatre@intel.com>
Fri, 29 Jan 2010 19:13:57 +0000 (11:13 -0800)
There's no need to queue a work struct from
within a work struct, just move the code to
execute directly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/iwlwifi/iwl3945-base.c

index 1c54425afe22d253a65f9c28f95b1856af4e9426..b528a20ade4f916ad653b430eeda97d9ca1a05db 100644 (file)
@@ -2439,18 +2439,6 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)
        return;
 }
 
-static void iwl_bg_up(struct work_struct *data)
-{
-       struct iwl_priv *priv = container_of(data, struct iwl_priv, up);
-
-       if (test_bit(STATUS_EXIT_PENDING, &priv->status))
-               return;
-
-       mutex_lock(&priv->mutex);
-       __iwl_up(priv);
-       mutex_unlock(&priv->mutex);
-}
-
 static void iwl_bg_restart(struct work_struct *data)
 {
        struct iwl_priv *priv = container_of(data, struct iwl_priv, restart);
@@ -2467,7 +2455,13 @@ static void iwl_bg_restart(struct work_struct *data)
                ieee80211_restart_hw(priv->hw);
        } else {
                iwl_down(priv);
-               queue_work(priv->workqueue, &priv->up);
+
+               if (test_bit(STATUS_EXIT_PENDING, &priv->status))
+                       return;
+
+               mutex_lock(&priv->mutex);
+               __iwl_up(priv);
+               mutex_unlock(&priv->mutex);
        }
 }
 
@@ -3285,7 +3279,6 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)
 
        init_waitqueue_head(&priv->wait_command_queue);
 
-       INIT_WORK(&priv->up, iwl_bg_up);
        INIT_WORK(&priv->restart, iwl_bg_restart);
        INIT_WORK(&priv->rx_replenish, iwl_bg_rx_replenish);
        INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update);
index 9b0a5cbc20f9d5ccad13dacd01ded5532013c07d..1cd565aef62cd63493c5a3163a4c60ecfda547c3 100644 (file)
@@ -1264,7 +1264,6 @@ struct iwl_priv {
 
        struct workqueue_struct *workqueue;
 
-       struct work_struct up;
        struct work_struct restart;
        struct work_struct calibrated_work;
        struct work_struct scan_completed;
index cd42b5838b383aa313dc8408de21b2e8271befce..119da54116de696400fdf547df16af6bc4cbd716 100644 (file)
@@ -3033,18 +3033,6 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
        mutex_unlock(&priv->mutex);
 }
 
-static void iwl3945_bg_up(struct work_struct *data)
-{
-       struct iwl_priv *priv = container_of(data, struct iwl_priv, up);
-
-       if (test_bit(STATUS_EXIT_PENDING, &priv->status))
-               return;
-
-       mutex_lock(&priv->mutex);
-       __iwl3945_up(priv);
-       mutex_unlock(&priv->mutex);
-}
-
 static void iwl3945_bg_restart(struct work_struct *data)
 {
        struct iwl_priv *priv = container_of(data, struct iwl_priv, restart);
@@ -3061,7 +3049,13 @@ static void iwl3945_bg_restart(struct work_struct *data)
                ieee80211_restart_hw(priv->hw);
        } else {
                iwl3945_down(priv);
-               queue_work(priv->workqueue, &priv->up);
+
+               if (test_bit(STATUS_EXIT_PENDING, &priv->status))
+                       return;
+
+               mutex_lock(&priv->mutex);
+               __iwl3945_up(priv);
+               mutex_unlock(&priv->mutex);
        }
 }
 
@@ -3782,7 +3776,6 @@ static void iwl3945_setup_deferred_work(struct iwl_priv *priv)
 
        init_waitqueue_head(&priv->wait_command_queue);
 
-       INIT_WORK(&priv->up, iwl3945_bg_up);
        INIT_WORK(&priv->restart, iwl3945_bg_restart);
        INIT_WORK(&priv->rx_replenish, iwl3945_bg_rx_replenish);
        INIT_WORK(&priv->beacon_update, iwl3945_bg_beacon_update);