speedtch speedtch.c,1.35,1.36
Duncan Sands
duncan at infradead.org
Sat Oct 16 11:32:40 EDT 2004
Update of /home/cvs/speedtch
In directory phoenix.infradead.org:/tmp/cvs-serv31973
Modified Files:
speedtch.c
Log Message:
Give the name of the firmware file we succeeded in loading.
Index: speedtch.c
===================================================================
RCS file: /home/cvs/speedtch/speedtch.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- speedtch.c 15 Oct 2004 16:07:14 -0000 1.35
+++ speedtch.c 16 Oct 2004 15:32:38 -0000 1.36
@@ -595,28 +595,30 @@
{
char buf[24];
const u16 bcdDevice = instance->u.usb_dev->descriptor.bcdDevice;
+ const u8 major_revision = bcdDevice >> 8;
+ const u8 minor_revision = bcdDevice & 0xff;
- sprintf(buf, "speedtch-%d.bin.%x.%02x", phase, bcdDevice >> 8,
- bcdDevice & 0xff);
+ sprintf(buf, "speedtch-%d.bin.%x.%02x", phase, major_revision, minor_revision);
dbg("speedtch_find_firmware: looking for %s", buf);
- if (!request_firmware(fw_p, buf, &instance->u.usb_dev->dev))
- return 0;
-
- sprintf(buf, "speedtch-%d.bin.%x", phase, bcdDevice >> 8);
- dbg("speedtch_find_firmware: looking for %s", buf);
-
- if (!request_firmware(fw_p, buf, &instance->u.usb_dev->dev))
- return 0;
-
- sprintf(buf, "speedtch-%d.bin", phase);
- dbg("speedtch_find_firmware: looking for %s", buf);
+ if (request_firmware(fw_p, buf, &instance->u.usb_dev->dev)) {
+ sprintf(buf, "speedtch-%d.bin.%x", phase, major_revision);
+ dbg("speedtch_find_firmware: looking for %s", buf);
+
+ if (request_firmware(fw_p, buf, &instance->u.usb_dev->dev)) {
+ sprintf(buf, "speedtch-%d.bin", phase);
+ dbg("speedtch_find_firmware: looking for %s", buf);
+
+ if (request_firmware(fw_p, buf, &instance->u.usb_dev->dev)) {
+ dev_warn(&instance->u.usb_dev->dev, "no stage %d firmware found!", phase);
+ return -ENOENT;
+ }
+ }
+ }
- if (!request_firmware(fw_p, buf, &instance->u.usb_dev->dev))
- return 0;
+ dev_info(&instance->u.usb_dev->dev, "found stage %d firmware %s\n", phase, buf);
- dev_warn(&instance->u.usb_dev->dev, "no stage %d firmware found!", phase);
- return -ENOENT;
+ return 0;
}
static int speedtch_load_firmware(void *arg)
@@ -629,9 +631,7 @@
daemonize("firmware/speedtch");
if (!speedtch_find_firmware(instance, 1, &fw1)) {
- dev_info(&instance->u.usb_dev->dev, "stage 1 firmware found!\n");
if (!speedtch_find_firmware(instance, 2, &fw2)) {
- dev_info(&instance->u.usb_dev->dev, "stage 2 firmware found!\n");
speedtch_upload_firmware(instance, fw1, fw2);
release_firmware(fw2);
}
More information about the Usbatm-commits
mailing list