From: Johannes Berg This order is going to become required, since userspace can query the regulatory in the window between the two registrations. Signed-off-by: Johannes Berg --- drivers/net/wireless/ath/ath12k/mac.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 01f8c6572f65..2b52f76cff10 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -15094,6 +15094,14 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah) for_each_ar(ah, ar, i) complete_all(&ar->regd_update_completed); + for_each_ar(ah, ar, i) { + ret = ath12k_regd_update(ar, true); + if (ret) { + ath12k_err(ar->ab, "ath12k regd update failed: %d\n", ret); + goto err_cleanup_if_combs; + } + } + ret = ieee80211_register_hw(hw); if (ret) { ath12k_err(ab, "ieee80211 registration failed: %d\n", ret); @@ -15111,13 +15119,6 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah) for_each_ar(ah, ar, i) { struct ath12k_base *this_ab = ar->ab; - /* Apply the regd received during initialization */ - ret = ath12k_regd_update(ar, true); - if (ret) { - ath12k_err(this_ab, "ath12k regd update failed: %d\n", ret); - goto err_unregister_hw; - } - if (this_ab->hw_params->current_cc_support) { struct wmi_set_current_country_arg current_cc = {}; struct ieee80211_regdomain *default_regd; @@ -15158,12 +15159,6 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah) return 0; -err_unregister_hw: - for_each_ar(ah, ar, i) - ath12k_debugfs_unregister(ar); - - ieee80211_unregister_hw(hw); - err_cleanup_if_combs: ath12k_mac_cleanup_iface_combinations(ah); -- 2.56.0