Commit 18816424 authored by Duncan Sands's avatar Duncan Sands Committed by Greg Kroah-Hartman

USB SpeedTouch cleanup.

 - Don't free pages with kfree()
 - Clean up debugging messages
 - Print name of firmware file loaded.
Signed-off-by: default avatarDuncan Sands <baldrick@free.fr>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent b5b2b4a8
...@@ -165,8 +165,7 @@ static void speedtch_got_firmware(struct speedtch_instance_data *instance, ...@@ -165,8 +165,7 @@ static void speedtch_got_firmware(struct speedtch_instance_data *instance,
goto out; goto out;
} }
if ((err = usb_set_interface(instance->u.usb_dev, 1, 1)) < 0) { if ((err = usb_set_interface(instance->u.usb_dev, 1, 1)) < 0) {
dbg("speedtch_got_firmware: usb_set_interface returned %d!", dbg("speedtch_got_firmware: usb_set_interface returned %d!", err);
err);
instance->u.status = UDSL_NO_FIRMWARE; instance->u.status = UDSL_NO_FIRMWARE;
goto out; goto out;
} }
...@@ -572,7 +571,7 @@ static void speedtch_upload_firmware(struct speedtch_instance_data *instance, ...@@ -572,7 +571,7 @@ static void speedtch_upload_firmware(struct speedtch_instance_data *instance,
/* Start modem synchronisation */ /* Start modem synchronisation */
if (speedtch_start_synchro(instance)) if (speedtch_start_synchro(instance))
dbg("speedtch_start_synchro: failed\n"); dbg("speedtch_start_synchro: failed");
speedtch_got_firmware(instance, 1); speedtch_got_firmware(instance, 1);
...@@ -585,7 +584,7 @@ static void speedtch_upload_firmware(struct speedtch_instance_data *instance, ...@@ -585,7 +584,7 @@ static void speedtch_upload_firmware(struct speedtch_instance_data *instance,
the firmware themselves */ the firmware themselves */
usb_driver_release_interface(&speedtch_usb_driver, intf); usb_driver_release_interface(&speedtch_usb_driver, intf);
fail_free: fail_free:
kfree(buffer); free_page((unsigned long)buffer);
fail: fail:
speedtch_got_firmware(instance, 0); speedtch_got_firmware(instance, 0);
} }
...@@ -596,28 +595,30 @@ static int speedtch_find_firmware(struct speedtch_instance_data ...@@ -596,28 +595,30 @@ static int speedtch_find_firmware(struct speedtch_instance_data
{ {
char buf[24]; char buf[24];
const u16 bcdDevice = instance->u.usb_dev->descriptor.bcdDevice; 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, sprintf(buf, "speedtch-%d.bin.%x.%02x", phase, major_revision, minor_revision);
bcdDevice & 0xff); dbg("speedtch_find_firmware: looking for %s", buf);
dbg("speedtch_find_firmware: looking for %s\n", buf);
if (!request_firmware(fw_p, buf, &instance->u.usb_dev->dev)) if (request_firmware(fw_p, buf, &instance->u.usb_dev->dev)) {
return 0; sprintf(buf, "speedtch-%d.bin.%x", phase, major_revision);
dbg("speedtch_find_firmware: looking for %s", buf);
sprintf(buf, "speedtch-%d.bin.%x", phase, bcdDevice >> 8); if (request_firmware(fw_p, buf, &instance->u.usb_dev->dev)) {
dbg("speedtch_find_firmware: looking for %s\n", buf); 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)) if (request_firmware(fw_p, buf, &instance->u.usb_dev->dev)) {
return 0; dev_warn(&instance->u.usb_dev->dev, "no stage %d firmware found!", phase);
return -ENOENT;
sprintf(buf, "speedtch-%d.bin", phase); }
dbg("speedtch_find_firmware: looking for %s\n", buf); }
}
if (!request_firmware(fw_p, buf, &instance->u.usb_dev->dev)) dev_info(&instance->u.usb_dev->dev, "found stage %d firmware %s\n", phase, buf);
return 0;
dev_warn(&instance->u.usb_dev->dev, "no stage %d firmware found!", phase); return 0;
return -ENOENT;
} }
static int speedtch_load_firmware(void *arg) static int speedtch_load_firmware(void *arg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment