iwlegacy: remove sync_cmd_mutex
authorStanislaw Gruszka <sgruszka@redhat.com>
Thu, 28 Apr 2011 09:51:33 +0000 (11:51 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 29 Apr 2011 19:36:15 +0000 (15:36 -0400)
We now use priv->mutex to serialize sync command, remove old
priv->sync_cmd_mutex and add assertion that priv->mutex must be locked.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlegacy/iwl-dev.h
drivers/net/wireless/iwlegacy/iwl-hcmd.c
drivers/net/wireless/iwlegacy/iwl3945-base.c
drivers/net/wireless/iwlegacy/iwl4965-base.c

index df19d5c69e7f065e035f2f2ff5e1036e419c1a59..2d87dba2cfa3d137802d14f219b33d63f6f6fc77 100644 (file)
@@ -1077,7 +1077,6 @@ struct iwl_priv {
        spinlock_t hcmd_lock;   /* protect hcmd */
        spinlock_t reg_lock;    /* protect hw register access */
        struct mutex mutex;
-       struct mutex sync_cmd_mutex; /* enable serialization of sync commands */
 
        /* basic pci-network driver stuff */
        struct pci_dev *pci_dev;
index 9d721cbda5bb04560e62fca55a5a25d767369acf..62b4b09122cbac4489561a0a1428cc70d7a5b538 100644 (file)
@@ -145,6 +145,8 @@ int iwl_legacy_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
        int cmd_idx;
        int ret;
 
+       lockdep_assert_held(&priv->mutex);
+
        BUG_ON(cmd->flags & CMD_ASYNC);
 
         /* A synchronous command can not have a callback set. */
@@ -152,7 +154,6 @@ int iwl_legacy_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 
        IWL_DEBUG_INFO(priv, "Attempting to send sync command %s\n",
                        iwl_legacy_get_cmd_string(cmd->id));
-       mutex_lock(&priv->sync_cmd_mutex);
 
        set_bit(STATUS_HCMD_ACTIVE, &priv->status);
        IWL_DEBUG_INFO(priv, "Setting HCMD_ACTIVE for command %s\n",
@@ -224,7 +225,6 @@ fail:
                cmd->reply_page = 0;
        }
 out:
-       mutex_unlock(&priv->sync_cmd_mutex);
        return ret;
 }
 EXPORT_SYMBOL(iwl_legacy_send_cmd_sync);
index 5bdcc36f543f4314bbf2734ec936bc746880e88c..0ee6be6a9c5db74c4b8b603e8b5e705641393d8f 100644 (file)
@@ -3815,7 +3815,6 @@ static int iwl3945_init_drv(struct iwl_priv *priv)
        INIT_LIST_HEAD(&priv->free_frames);
 
        mutex_init(&priv->mutex);
-       mutex_init(&priv->sync_cmd_mutex);
 
        priv->ieee_channels = NULL;
        priv->ieee_rates = NULL;
index 55851ac3add9e3b935bed010f3d0ef89bd98f4ab..f781b7e225b466679d5a8738ae69ee74f01c833b 100644 (file)
@@ -3124,7 +3124,6 @@ static int iwl4965_init_drv(struct iwl_priv *priv)
        INIT_LIST_HEAD(&priv->free_frames);
 
        mutex_init(&priv->mutex);
-       mutex_init(&priv->sync_cmd_mutex);
 
        priv->ieee_channels = NULL;
        priv->ieee_rates = NULL;