aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ti_usb_3410_5052.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-08-11 16:49:23 +0200
committerBen Hutchings <ben@decadent.org.uk>2013-09-10 01:57:23 +0100
commitc372ce3c31bf53445e71426b56252ca8238c330f (patch)
tree5ca0c8c77e45024c7e88440ec690ea014b042fa6 /drivers/usb/serial/ti_usb_3410_5052.c
parent735143e24807a8202d2fde8999eab1c3b761949d (diff)
downloadkernel_samsung_smdk4412-c372ce3c31bf53445e71426b56252ca8238c330f.zip
kernel_samsung_smdk4412-c372ce3c31bf53445e71426b56252ca8238c330f.tar.gz
kernel_samsung_smdk4412-c372ce3c31bf53445e71426b56252ca8238c330f.tar.bz2
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> [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/usb/serial/ti_usb_3410_5052.c')
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c9
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 42038ba..885d15d 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -1713,12 +1713,13 @@ static int ti_download_firmware(struct ti_device *tdev)
dbg("%s\n", __func__);
/* try ID specific firmware first, then try generic firmware */
- sprintf(buf, "ti_usb-v%04x-p%04x.fw", dev->descriptor.idVendor,
- dev->descriptor.idProduct);
+ sprintf(buf, "ti_usb-v%04x-p%04x.fw",
+ le16_to_cpu(dev->descriptor.idVendor),
+ le16_to_cpu(dev->descriptor.idProduct));
if ((status = request_firmware(&fw_p, buf, &dev->dev)) != 0) {
buf[0] = '\0';
- if (dev->descriptor.idVendor == MTS_VENDOR_ID) {
- switch (dev->descriptor.idProduct) {
+ if (le16_to_cpu(dev->descriptor.idVendor) == MTS_VENDOR_ID) {
+ switch (le16_to_cpu(dev->descriptor.idProduct)) {
case MTS_CDMA_PRODUCT_ID:
strcpy(buf, "mts_cdma.fw");
break;