Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e877dd2f authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

USB: ti_usb_3410_5052: fix big-endian firmware handling



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.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d482b9d5
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -1536,14 +1536,15 @@ static int ti_download_firmware(struct ti_device *tdev)
	char buf[32];
	char buf[32];


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


	if (status != 0) {
	if (status != 0) {
		buf[0] = '\0';
		buf[0] = '\0';
		if (dev->descriptor.idVendor == MTS_VENDOR_ID) {
		if (le16_to_cpu(dev->descriptor.idVendor) == MTS_VENDOR_ID) {
			switch (dev->descriptor.idProduct) {
			switch (le16_to_cpu(dev->descriptor.idProduct)) {
			case MTS_CDMA_PRODUCT_ID:
			case MTS_CDMA_PRODUCT_ID:
				strcpy(buf, "mts_cdma.fw");
				strcpy(buf, "mts_cdma.fw");
				break;
				break;