diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c63884c4af2b..6d6e956cf240 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2987,11 +2987,7 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, bool reinit) } hdd_ctx->start_modules_in_progress = false; - if (DRIVER_MODULES_ENABLED == hdd_ctx->driver_status) { - ret = hdd_update_country_code(hdd_ctx); - if (ret) - hdd_err("Failed to update command line country code!"); - } + mutex_unlock(&hdd_ctx->iface_change_lock); hdd_exit(); @@ -10463,6 +10459,12 @@ static int hdd_features_init(struct hdd_context *hdd_ctx) hdd_enter(); + ret = hdd_update_country_code(hdd_ctx); + if (ret) { + hdd_err("Failed to update country code; errno:%d", ret); + return -EINVAL; + } + ret = hdd_init_mws_coex(hdd_ctx); if (ret) hdd_warn("Error initializing mws-coex"); diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index 48ab2baef5ff..041928ea5870 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -685,13 +685,7 @@ void hdd_program_country_code(struct hdd_context *hdd_ctx) int hdd_reg_set_country(struct hdd_context *hdd_ctx, char *country_code) { - int err; - QDF_STATUS status = QDF_STATUS_SUCCESS; - - /* validation */ - err = wlan_hdd_validate_context(hdd_ctx); - if (err) - return err; + QDF_STATUS status; if (!country_code) { hdd_err("country_code is null"); @@ -699,7 +693,6 @@ int hdd_reg_set_country(struct hdd_context *hdd_ctx, char *country_code) } status = ucfg_reg_set_country(hdd_ctx->hdd_pdev, country_code); - if (QDF_IS_STATUS_ERROR(status)) hdd_err("Failed to set country");