[PATCH] Fix cs firmware loading

Dan Williams dcbw at redhat.com
Wed Oct 15 11:08:41 EDT 2008


On Wed, 2008-10-15 at 09:29 +1300, Ryan Mallon wrote:
> The function if_cs_poll_while_fw_download returns the number of 
> iterations through the loop on success. This value is returned by
> the functions if_cs_prog_helper and if_cs_prog_real, however they
> should return zero on success. This patch corrects that. An 
> alternative would be to just return zero on success from 
> if_cs_poll_while_fw_download.

Yeah, just have if_cs_poll_while_fw_download() return 0 on success,
since nowhere acutally cares how many iterations were used.

BTW, I assume you guys are using 8335 hardware version b2 and later,
right?

Thanks!
Dan


> Signed-off-by: Ryan Mallon <ryan at bluewatersys.com>
> 
> diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
> index 842a08d..13e1f59 100644
> --- a/drivers/net/wireless/libertas/if_cs.c
> +++ b/drivers/net/wireless/libertas/if_cs.c
> @@ -598,8 +598,10 @@ static int if_cs_prog_helper(struct if_cs_card *card)
>  			goto err_release;
>  		}
>  
> -		if (count == 0)
> +		if (count == 0) {
> +			ret = 0;
>  			break;
> +		}
>  
>  		sent += count;
>  	}
> @@ -677,6 +679,8 @@ static int if_cs_prog_real(struct if_cs_card *card)
>  	ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a);
>  	if (ret < 0)
>  		lbs_pr_err("firmware download failed\n");
> +	else
> +		ret = 0;
>  
>  err_release:
>  	release_firmware(fw);
> 




More information about the libertas-dev mailing list