[PATCH 2/2] ath10k: check otp.bin result

Kalle Valo kvalo at qca.qualcomm.com
Tue Mar 11 13:10:54 EDT 2014


Kalle Valo <kvalo at qca.qualcomm.com> writes:

> When we execute otp.bin in the target check that the result it returns doesn't
> contain an error. This is to make sure that we don't accidentally use invalid
> calibration data.
>
> While at it, remove the useless label in the function and add few debug messages.
>
> Signed-off-by: Kalle Valo <kvalo at qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath10k/core.c |   21 ++++++++++++++++-----
>  1 file changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> index 602fb9644cbf..e8f419144db6 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -254,23 +254,34 @@ static int ath10k_download_and_run_otp(struct ath10k *ar)
>  
>  	/* OTP is optional */
>  
> -	if (!ar->otp_data || !ar->otp_len)
> +	if (!ar->otp_data || !ar->otp_len) {
> +		ath10k_warn("Not running otp, calibration will be incorrect!\n");
>  		return 0;
> +	}
> +
> +	ath10k_dbg(ATH10K_DBG_BOOT, "boot upload otp to 0x%x len %d\n",
> +		   address, ar->otp_len);

This one introduces a warning:

>> drivers/net/wireless/ath/ath10k/core.c:263:6: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' [-Wformat=]
         address, ar->otp_len);

I fixed it to this:

	ath10k_dbg(ATH10K_DBG_BOOT, "boot upload otp to 0x%x len %zd\n",
		   address, ar->otp_len);

-- 
Kalle Valo



More information about the ath10k mailing list