Skip to contentSkip to conversation

libertas: unify request_firmware failure

RFC PATCH In review Marc Pignat 2 participants 2 messages Oct 1, 2008 2 messages not in the archive Networking drivers (wireless)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

RFC PATCH v2 1/1 libertas: unify request_firmware failure

Use almost the same string for all interfaces (USB, compact flash and SDIO) when request_firmware fails.

---

Hi all!

This patch is an attemp to clarify the message "firmware not found, please fix your userspace (== this is not a libertas bug)".

changes from v1:
* replaced %#x with %d because "ret" is supposed to be a negative integer (suggested by Dan Williams).

Best regards

Marc

patch agaisnt 2.6.27-rc7:

drivers/net/wireless/libertas/if_cs.c +4 -2
index 8941919..5f8e68b 100644
@@ -553,7 +553,8 @@ static int if_cs_prog_helper(struct if_cs_card *card)
 	ret = request_firmware(&fw, "libertas_cs_helper.fw",
 		&handle_to_dev(card->p_dev));
 	if (ret) {
-		lbs_pr_err("can't load helper firmware\n");
+		lbs_pr_err("request_firmware() failed with %d\n", ret);
+		lbs_pr_err("helper firmware libertas_cs_helper.fw not found\n");
 		ret = -ENODEV;
 		goto done;
 	}
@@ -626,7 +627,8 @@ static int if_cs_prog_real(struct if_cs_card *card)
 	ret = request_firmware(&fw, "libertas_cs.fw",
 		&handle_to_dev(card->p_dev));
 	if (ret) {
-		lbs_pr_err("can't load firmware\n");
+		lbs_pr_err("request_firmware() failed with %d\n", ret);
+		lbs_pr_err("firmware libertas_cs.fw not found\n");
 		ret = -ENODEV;
 		goto done;
 	}
drivers/net/wireless/libertas/if_sdio.c +4 -2
index b54e2ea..319e211 100644
@@ -396,7 +396,8 @@ static int if_sdio_prog_helper(struct if_sdio_card *card)
 
 	ret = request_firmware(&fw, card->helper, &card->func->dev);
 	if (ret) {
-		lbs_pr_err("can't load helper firmware\n");
+		lbs_pr_err("request_firmware() failed with %d\n", ret);
+		lbs_pr_err("helper firmware %s not found\n", card->helper);
 		goto out;
 	}
 
@@ -512,7 +513,8 @@ static int if_sdio_prog_real(struct if_sdio_card *card)
 
 	ret = request_firmware(&fw, card->firmware, &card->func->dev);
 	if (ret) {
-		lbs_pr_err("can't load firmware\n");
+		lbs_pr_err("request_firmware() failed with %d\n", ret);
+		lbs_pr_err("firmware %s not found\n", card->firmware);
 		goto out;
 	}
 
drivers/net/wireless/libertas/if_usb.c +1 -1
index 632c291..285be43 100644
@@ -819,7 +819,7 @@ static int if_usb_prog_firmware(struct if_usb_card *cardp)
 
 	if ((ret = request_firmware(&cardp->fw, lbs_fw_name,
 				    &cardp->udev->dev)) < 0) {
-		lbs_pr_err("request_firmware() failed with %#x\n", ret);
+		lbs_pr_err("request_firmware() failed with %d\n", ret);
 		lbs_pr_err("firmware %s not found\n", lbs_fw_name);
 		goto done;
 	}
#3 lore raw

drivers/net/wireless/libertas/if_cs.c static int if_cs_prog_helper(struct if_cs_card *card)

Quoted 3 lines
drivers/net/wireless/libertas/if_cs.c +2 -1
-		lbs_pr_err("can't load helper firmware\n");
+		lbs_pr_err("request_firmware() failed with %d\n", ret);
+		lbs_pr_err("helper firmware libertas_cs_helper.fw not found\n"); ret = -ENODEV;

While I don't have a problem with the idea per se, I don't like it outputting two error lines now.

So for if_cs.c, I like the original code better.

I don't care to emit the error number, won't be usable to most people anyway. And I don't care about outputting the filename, because udev will already show you the filename if it doesn't find what was requested.