[PATCH] Fix cs firmware loading

Ryan Mallon ryan at bluewatersys.com
Tue Oct 14 16:29:45 EDT 2008


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.

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);

-- 
Bluewater Systems Ltd - ARM Technology Solution Centre

       Ryan Mallon                              Unit 5, Amuri Park
       Phone: +64 3 3779127                     404 Barbadoes St
       Fax:   +64 3 3779135                     PO Box 13 889
       Email: ryan at bluewatersys.com             Christchurch, 8013
       Web:   http://www.bluewatersys.com       New Zealand
       Freecall Australia  1800 148 751         USA 1800 261 2934




More information about the libertas-dev mailing list