linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath3k: output firmware filename when request_firmware failed
@ 2011-10-29 17:52 Paul Fertser
  2011-10-31 20:02 ` Gustavo Padovan
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Fertser @ 2011-10-29 17:52 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth, Paul Fertser

This makes it much easier for the users to understand why the driver
refuses to load when the firmware is unavailable.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
---
 drivers/bluetooth/ath3k.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index db7cb81..1f04d4c 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -30,6 +30,7 @@
 #include <net/bluetooth/bluetooth.h>
 
 #define VERSION "1.0"
+#define ATH3K_MODULE_FIRMWARE	"ath3k-1.fw"
 
 #define ATH3K_DNLOAD				0x01
 #define ATH3K_GETSTATE				0x05
@@ -400,9 +401,15 @@ static int ath3k_probe(struct usb_interface *intf,
 		return 0;
 	}
 
-	if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) {
-		BT_ERR("Error loading firmware");
-		return -EIO;
+	ret = request_firmware(&firmware, ATH3K_MODULE_FIRMWARE, &udev->dev);
+	if (ret < 0) {
+		if (ret == -ENOENT)
+			BT_ERR("Firmware file \"%s\" not found",
+				ATH3K_MODULE_FIRMWARE);
+		else
+			BT_ERR("Firmware file \"%s\" request failed (err=%d)",
+				ATH3K_MODULE_FIRMWARE, ret);
+		return ret;
 	}
 
 	ret = ath3k_load_firmware(udev, firmware);
@@ -441,4 +448,4 @@ MODULE_AUTHOR("Atheros Communications");
 MODULE_DESCRIPTION("Atheros AR30xx firmware driver");
 MODULE_VERSION(VERSION);
 MODULE_LICENSE("GPL");
-MODULE_FIRMWARE("ath3k-1.fw");
+MODULE_FIRMWARE(ATH3K_MODULE_FIRMWARE);
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ath3k: output firmware filename when request_firmware failed
  2011-10-29 17:52 [PATCH] ath3k: output firmware filename when request_firmware failed Paul Fertser
@ 2011-10-31 20:02 ` Gustavo Padovan
  0 siblings, 0 replies; 2+ messages in thread
From: Gustavo Padovan @ 2011-10-31 20:02 UTC (permalink / raw)
  To: Paul Fertser; +Cc: Marcel Holtmann, linux-bluetooth

Hi Paul,

* Paul Fertser <fercerpav@gmail.com> [2011-10-29 21:52:49 +0400]:

> This makes it much easier for the users to understand why the driver
> refuses to load when the firmware is unavailable.
> 
> Signed-off-by: Paul Fertser <fercerpav@gmail.com>
> ---
>  drivers/bluetooth/ath3k.c |   15 +++++++++++----
>  1 files changed, 11 insertions(+), 4 deletions(-)

Applied, thanks.

	Gustavo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-31 20:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-29 17:52 [PATCH] ath3k: output firmware filename when request_firmware failed Paul Fertser
2011-10-31 20:02 ` Gustavo Padovan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).