Commit c6ce492d authored by Kalle Valo's avatar Kalle Valo

ath10k: clean up error handling in ath10k_core_probe_fw()

Use the error handling style preferred in ath10k. Makes it easier to add
ath10k_init_firmware_features() function in the next patch.
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 3a8200b2
...@@ -1096,8 +1096,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar) ...@@ -1096,8 +1096,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
ret = ath10k_bmi_get_target_info(ar, &target_info); ret = ath10k_bmi_get_target_info(ar, &target_info);
if (ret) { if (ret) {
ath10k_err(ar, "could not get target info (%d)\n", ret); ath10k_err(ar, "could not get target info (%d)\n", ret);
ath10k_hif_power_down(ar); goto err_power_down;
return ret;
} }
ar->target_version = target_info.version; ar->target_version = target_info.version;
...@@ -1106,15 +1105,13 @@ static int ath10k_core_probe_fw(struct ath10k *ar) ...@@ -1106,15 +1105,13 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
ret = ath10k_init_hw_params(ar); ret = ath10k_init_hw_params(ar);
if (ret) { if (ret) {
ath10k_err(ar, "could not get hw params (%d)\n", ret); ath10k_err(ar, "could not get hw params (%d)\n", ret);
ath10k_hif_power_down(ar); goto err_power_down;
return ret;
} }
ret = ath10k_core_fetch_firmware_files(ar); ret = ath10k_core_fetch_firmware_files(ar);
if (ret) { if (ret) {
ath10k_err(ar, "could not fetch firmware files (%d)\n", ret); ath10k_err(ar, "could not fetch firmware files (%d)\n", ret);
ath10k_hif_power_down(ar); goto err_power_down;
return ret;
} }
ath10k_core_init_max_sta_count(ar); ath10k_core_init_max_sta_count(ar);
...@@ -1124,10 +1121,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar) ...@@ -1124,10 +1121,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
ret = ath10k_core_start(ar, ATH10K_FIRMWARE_MODE_NORMAL); ret = ath10k_core_start(ar, ATH10K_FIRMWARE_MODE_NORMAL);
if (ret) { if (ret) {
ath10k_err(ar, "could not init core (%d)\n", ret); ath10k_err(ar, "could not init core (%d)\n", ret);
ath10k_core_free_firmware_files(ar); goto err_unlock;
ath10k_hif_power_down(ar);
mutex_unlock(&ar->conf_mutex);
return ret;
} }
ath10k_print_driver_info(ar); ath10k_print_driver_info(ar);
...@@ -1137,6 +1131,16 @@ static int ath10k_core_probe_fw(struct ath10k *ar) ...@@ -1137,6 +1131,16 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
ath10k_hif_power_down(ar); ath10k_hif_power_down(ar);
return 0; return 0;
err_unlock:
mutex_unlock(&ar->conf_mutex);
ath10k_core_free_firmware_files(ar);
err_power_down:
ath10k_hif_power_down(ar);
return ret;
} }
static void ath10k_core_register_work(struct work_struct *work) static void ath10k_core_register_work(struct work_struct *work)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment