aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZheng Yongjun <[email protected]>2021-08-02 17:28:26 +0300
committerLuca Coelho <[email protected]>2021-08-26 23:33:24 +0300
commit5993c90ccb56b34aaedfd77a1c67c7a2039090ee (patch)
tree8f0d1fad1c85a8b902be5bbfc1890d8de625cae8
parent2b06127df02fbca66d0098e9a1d3eaf62bb5e9c8 (diff)
iwlwifi: use DEFINE_MUTEX() for mutex lock
mutex lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init(). Signed-off-by: Zheng Yongjun <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20210802172232.2a583d006739.Ia782c08525397b6430b1c877a870d688a7f3f494@changeid Signed-off-by: Luca Coelho <[email protected]>
-rw-r--r--drivers/net/wireless/intel/iwlwifi/iwl-drv.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index 977dce686bdb..77124b8b235e 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -78,7 +78,7 @@ enum {
};
/* Protects the table contents, i.e. the ops pointer & drv list */
-static struct mutex iwlwifi_opmode_table_mtx;
+static DEFINE_MUTEX(iwlwifi_opmode_table_mtx);
static struct iwlwifi_opmode_table {
const char *name; /* name: iwldvm, iwlmvm, etc */
const struct iwl_op_mode_ops *ops; /* pointer to op_mode ops */
@@ -1754,8 +1754,6 @@ static int __init iwl_drv_init(void)
{
int i, err;
- mutex_init(&iwlwifi_opmode_table_mtx);
-
for (i = 0; i < ARRAY_SIZE(iwlwifi_opmode_table); i++)
INIT_LIST_HEAD(&iwlwifi_opmode_table[i].drv);