[RFC, PATCH] libertas: unify request_firmware failure
Dan Williams
dcbw at redhat.com
Tue Sep 30 12:34:40 EDT 2008
On Tue, 2008-09-30 at 16:25 +0200, Marc Pignat wrote:
> Use almost the same string for all interfaces (USB, compact flash and SDIO)
> when request_firmware fails.
>
> Signed-off-by: Marc Pignat <marc.pignat at hevs.ch>
Can you send to linux-wireless at vger.kernel.org as well? I'll ack it
then and John will pick it up automagically. A few issues below:
> ---
>
> Hi all!
>
> I'm tired of seeing always the same problem with firmware. Some guys are not
> able to setup a working userland for hotplugging (firmware download) to work.
>
> I understand that working with embedded system is not as simple as booting a
> live distro on any x86 machine.
>
> I really think this *dumb* patch will make our life easier. When you see
> a message like "request_firmware() failed with ...", there is no need to
> blame the libertas driver, that only means that your userspace is broken.
>
>
>
> Best regards
>
> Marc
>
>
>
>
> patch against 2.6.27-rc7 (if_usb.c is untouched, it holds the original string!)
>
> diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
> index 8941919..53af9f5 100644
> --- a/drivers/net/wireless/libertas/if_cs.c
> +++ b/drivers/net/wireless/libertas/if_cs.c
> @@ -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 %#x\n", ret);
'ret' is actually supposed to be an integer, do %d is more appropriate
here than %x.
> + 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 %#x\n", ret);
> + lbs_pr_err("firmware libertas_cs.fw not found\n");
Same here, %d.
> ret = -ENODEV;
> goto done;
> }
> diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
> index b54e2ea..734d0fa 100644
> --- a/drivers/net/wireless/libertas/if_sdio.c
> +++ b/drivers/net/wireless/libertas/if_sdio.c
> @@ -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 %#x\n", ret);
%d
> + 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 %#x\n", ret);
%d
Other than that, looks fine.
Thanks!
Dan
> + lbs_pr_err("firmware %s not found\n", card->firmware);
> goto out;
> }
>
>
> _______________________________________________
> libertas-dev mailing list
> libertas-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev
More information about the libertas-dev
mailing list