diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index bbf6ad8bee7b..480241a14269 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6669,8 +6669,7 @@ static int hdd_wiphy_init(struct hdd_context *hdd_ctx) return ret_val; } - if (!hdd_ctx->reg_offload) - hdd_program_country_code(hdd_ctx); + pld_increment_driver_load_cnt(hdd_ctx->parent_dev); return ret_val; } diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index 273db4eead35..ac7ea8c6cd77 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -708,8 +708,13 @@ void hdd_reg_notifier(struct wiphy *wiphy, request->dfs_region); switch (request->initiator) { - case NL80211_REGDOM_SET_BY_USER: case NL80211_REGDOM_SET_BY_CORE: + if (pld_get_driver_load_cnt(hdd_ctx->parent_dev) == 0) { + hdd_debug("ignore the 1st time notifier from CORE"); + return; + } + /* fall through to set country */ + case NL80211_REGDOM_SET_BY_USER: status = ucfg_reg_set_country(hdd_ctx->hdd_pdev, request->alpha2); break;