Skip to content

Commit e877dd2

Browse files
jhovoldgregkh
authored andcommitted
USB: ti_usb_3410_5052: fix big-endian firmware handling
Fix endianess bugs in firmware handling introduced by commits cb7a7c6 ("ti_usb_3410_5052: add Multi-Tech modem support") and 05a3d90 ("ti_usb_3410_5052: support alternate firmware") which made the driver use the wrong firmware for certain devices on big-endian machines. Cc: [email protected] Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d482b9d commit e877dd2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/usb/serial/ti_usb_3410_5052.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,14 +1536,15 @@ static int ti_download_firmware(struct ti_device *tdev)
15361536
char buf[32];
15371537

15381538
/* try ID specific firmware first, then try generic firmware */
1539-
sprintf(buf, "ti_usb-v%04x-p%04x.fw", dev->descriptor.idVendor,
1540-
dev->descriptor.idProduct);
1539+
sprintf(buf, "ti_usb-v%04x-p%04x.fw",
1540+
le16_to_cpu(dev->descriptor.idVendor),
1541+
le16_to_cpu(dev->descriptor.idProduct));
15411542
status = request_firmware(&fw_p, buf, &dev->dev);
15421543

15431544
if (status != 0) {
15441545
buf[0] = '\0';
1545-
if (dev->descriptor.idVendor == MTS_VENDOR_ID) {
1546-
switch (dev->descriptor.idProduct) {
1546+
if (le16_to_cpu(dev->descriptor.idVendor) == MTS_VENDOR_ID) {
1547+
switch (le16_to_cpu(dev->descriptor.idProduct)) {
15471548
case MTS_CDMA_PRODUCT_ID:
15481549
strcpy(buf, "mts_cdma.fw");
15491550
break;

0 commit comments

Comments
 (0)