add chaos_calmer branch
[15.05/openwrt.git] / package / kernel / mac80211 / patches / 920-ath10k_allow_fallback_to_board_bin_on_empty_otp_stream.patch
1 --- a/drivers/net/wireless/ath/ath10k/core.c
2 +++ b/drivers/net/wireless/ath/ath10k/core.c
3 @@ -387,9 +387,14 @@ static int ath10k_download_and_run_otp(s
4  
5         ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot otp execute result %d\n", result);
6  
7 -       if (!skip_otp && result != 0) {
8 -               ath10k_err(ar, "otp calibration failed: %d", result);
9 -               return -EINVAL;
10 +       if (!skip_otp) {
11 +               if (result == 2) {
12 +                       ath10k_warn(ar, "otp stream is empty, using board.bin contents");
13 +                       return 0;
14 +               } else if (result != 0) {
15 +                       ath10k_err(ar, "otp calibration failed: %d", result);
16 +                       return -EINVAL;
17 +               }
18         }
19  
20         return 0;