wifi: iwlwifi: pass trans to iwl_parse_nvm_mcc_info()
authorJohannes Berg <johannes.berg@intel.com>
Thu, 8 May 2025 12:12:58 +0000 (15:12 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Fri, 9 May 2025 12:37:49 +0000 (15:37 +0300)
There's no need to pass various different pointers when
the transport is already established, so just pass that
instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-8-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h
drivers/net/wireless/intel/iwlwifi/mld/mcc.c
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

index 87f927ed2c6e6bb9a7ba5a125cdbe4673164c678..96dc27b93db1a2a22b9d271b1803160c3ccfca15 100644 (file)
@@ -1744,10 +1744,12 @@ static struct iwl_reg_capa iwl_get_reg_capa(u32 flags, u8 resp_ver)
 }
 
 struct ieee80211_regdomain *
-iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
+iwl_parse_nvm_mcc_info(struct iwl_trans *trans,
                       int num_of_ch, __le32 *channels, u16 fw_mcc,
                       u16 geo_info, u32 cap, u8 resp_ver)
 {
+       const struct iwl_cfg *cfg = trans->cfg;
+       struct device *dev = trans->dev;
        int ch_idx;
        u16 ch_flags;
        u32 reg_rule_flags, prev_reg_rule_flags = 0;
index 0c6c3fb8c6dd4f7c9af7998c92d892515dd4c739..17d22a68f0743b258edc937247171b7b70ad69f4 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
 /*
- * Copyright (C) 2005-2015, 2018-2024 Intel Corporation
+ * Copyright (C) 2005-2015, 2018-2025 Intel Corporation
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
  */
 #ifndef __iwl_nvm_parse_h__
@@ -46,9 +46,17 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,
  * accordingly. An ERR_PTR is returned on error.
  * If not given to the regulatory core, the user is responsible for freeing
  * the regdomain returned here with kfree.
+ *
+ * @trans: the transport
+ * @num_of_ch: the number of channels
+ * @channels: channel map
+ * @fw_mcc: firmware country code
+ * @geo_info: geo info value
+ * @cap: capability
+ * @resp_ver: FW response version
  */
 struct ieee80211_regdomain *
-iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
+iwl_parse_nvm_mcc_info(struct iwl_trans *trans,
                       int num_of_ch, __le32 *channels, u16 fw_mcc,
                       u16 geo_info, u32 cap, u8 resp_ver);
 
index daca14e208bde37ed997ddfd3c7818fa0a182355..19cb562e7a73fb3bd413a95427e5d6f67fa5e58e 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2024 Intel Corporation
+ * Copyright (C) 2024-2025 Intel Corporation
  */
 
 #include <net/cfg80211.h>
@@ -158,7 +158,7 @@ iwl_mld_get_regdomain(struct iwl_mld *mld,
        }
        IWL_DEBUG_LAR(mld, "MCC update response version: %d\n", resp_ver);
 
-       regd = iwl_parse_nvm_mcc_info(mld->trans->dev, mld->cfg,
+       regd = iwl_parse_nvm_mcc_info(mld->trans,
                                      __le32_to_cpu(resp->n_channels),
                                      resp->channels,
                                      __le16_to_cpu(resp->mcc),
index d15031f9f38c4f5367bda58b435c1dc02226c7be..a968f5401da1327b16f1ab7f2c88d8a27ed462c3 100644 (file)
@@ -146,7 +146,7 @@ struct ieee80211_regdomain *iwl_mvm_get_regdomain(struct wiphy *wiphy,
                                           MCC_UPDATE_CMD, 0);
        IWL_DEBUG_LAR(mvm, "MCC update response version: %d\n", resp_ver);
 
-       regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg,
+       regd = iwl_parse_nvm_mcc_info(mvm->trans,
                                      __le32_to_cpu(resp->n_channels),
                                      resp->channels,
                                      __le16_to_cpu(resp->mcc),