diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-08-11 10:49:23 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-20 11:43:04 -0400 |
commit | 0179a37034fd74b573e63e7175dc6e65249b5389 (patch) | |
tree | 13b39a2075616719951fb2b084c8442cd50c6989 | |
parent | 7048e6925f52536c37143518644a4beabdc4846f (diff) |
USB: ti_usb_3410_5052: fix big-endian firmware handling
commit e877dd2f2581628b7119df707d4cf03d940cff49 upstream.
Fix endianess bugs in firmware handling introduced by commits cb7a7c6a
("ti_usb_3410_5052: add Multi-Tech modem support") and 05a3d905
("ti_usb_3410_5052: support alternate firmware") which made the driver
use the wrong firmware for certain devices on big-endian machines.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/serial/ti_usb_3410_5052.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 01f79f11e5ad..32bdd5eac59b 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -1536,14 +1536,15 @@ static int ti_download_firmware(struct ti_device *tdev) | |||
1536 | char buf[32]; | 1536 | char buf[32]; |
1537 | 1537 | ||
1538 | /* try ID specific firmware first, then try generic firmware */ | 1538 | /* try ID specific firmware first, then try generic firmware */ |
1539 | sprintf(buf, "ti_usb-v%04x-p%04x.fw", dev->descriptor.idVendor, | 1539 | sprintf(buf, "ti_usb-v%04x-p%04x.fw", |
1540 | dev->descriptor.idProduct); | 1540 | le16_to_cpu(dev->descriptor.idVendor), |
1541 | le16_to_cpu(dev->descriptor.idProduct)); | ||
1541 | status = request_firmware(&fw_p, buf, &dev->dev); | 1542 | status = request_firmware(&fw_p, buf, &dev->dev); |
1542 | 1543 | ||
1543 | if (status != 0) { | 1544 | if (status != 0) { |
1544 | buf[0] = '\0'; | 1545 | buf[0] = '\0'; |
1545 | if (dev->descriptor.idVendor == MTS_VENDOR_ID) { | 1546 | if (le16_to_cpu(dev->descriptor.idVendor) == MTS_VENDOR_ID) { |
1546 | switch (dev->descriptor.idProduct) { | 1547 | switch (le16_to_cpu(dev->descriptor.idProduct)) { |
1547 | case MTS_CDMA_PRODUCT_ID: | 1548 | case MTS_CDMA_PRODUCT_ID: |
1548 | strcpy(buf, "mts_cdma.fw"); | 1549 | strcpy(buf, "mts_cdma.fw"); |
1549 | break; | 1550 | break; |