ath10k: fix a compiler warning
[openwrt/staging/yousong.git] / package / kernel / mac80211 / patches / 936-ath10k_skip_otp_check.patch
1 --- a/drivers/net/wireless/ath/ath10k/core.c
2 +++ b/drivers/net/wireless/ath/ath10k/core.c
3 @@ -1243,9 +1243,6 @@ static int ath10k_core_fetch_firmware_fi
4 {
5 int ret;
6
7 - /* calibration file is optional, don't check for any errors */
8 - ath10k_fetch_cal_file(ar);
9 -
10 ar->fw_api = 5;
11 ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
12
13 @@ -1944,7 +1941,7 @@ EXPORT_SYMBOL(ath10k_core_stop);
14 static int ath10k_core_probe_fw(struct ath10k *ar)
15 {
16 struct bmi_target_info target_info;
17 - int ret = 0;
18 + int calret, ret = 0;
19
20 ret = ath10k_hif_power_up(ar);
21 if (ret) {
22 @@ -1968,6 +1965,9 @@ static int ath10k_core_probe_fw(struct a
23 goto err_power_down;
24 }
25
26 + /* calibration file is optional, don't check for any errors */
27 + calret = ath10k_fetch_cal_file(ar);
28 +
29 ret = ath10k_core_fetch_firmware_files(ar);
30 if (ret) {
31 ath10k_err(ar, "could not fetch firmware files (%d)\n", ret);
32 @@ -1990,11 +1990,14 @@ static int ath10k_core_probe_fw(struct a
33 "could not load pre cal data: %d\n", ret);
34 }
35
36 - ret = ath10k_core_get_board_id_from_otp(ar);
37 - if (ret && ret != -EOPNOTSUPP) {
38 - ath10k_err(ar, "failed to get board id from otp: %d\n",
39 - ret);
40 - goto err_free_firmware_files;
41 + /* otp and board file not needed if calibration data is present */
42 + if (calret) {
43 + ret = ath10k_core_get_board_id_from_otp(ar);
44 + if (ret && ret != -EOPNOTSUPP) {
45 + ath10k_err(ar, "failed to get board id from otp: %d\n",
46 + ret);
47 + goto err_free_firmware_files;
48 + }
49 }
50
51 ret = ath10k_core_fetch_board_file(ar);