Commit c786138f authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: usbtmc: fix big-endian probe of Rigol devices

Fix probe of Rigol devices on big-endian machines. A quirk for these
devices was introduced by commit c2e31483 ("USB: usbtmc: Set
rigol_quirk if device is listed") but was only enabled on little-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 d551ec9b
...@@ -1119,11 +1119,11 @@ static int usbtmc_probe(struct usb_interface *intf, ...@@ -1119,11 +1119,11 @@ static int usbtmc_probe(struct usb_interface *intf,
/* Determine if it is a Rigol or not */ /* Determine if it is a Rigol or not */
data->rigol_quirk = 0; data->rigol_quirk = 0;
dev_dbg(&intf->dev, "Trying to find if device Vendor 0x%04X Product 0x%04X has the RIGOL quirk\n", dev_dbg(&intf->dev, "Trying to find if device Vendor 0x%04X Product 0x%04X has the RIGOL quirk\n",
data->usb_dev->descriptor.idVendor, le16_to_cpu(data->usb_dev->descriptor.idVendor),
data->usb_dev->descriptor.idProduct); le16_to_cpu(data->usb_dev->descriptor.idProduct));
for(n = 0; usbtmc_id_quirk[n].idVendor > 0; n++) { for(n = 0; usbtmc_id_quirk[n].idVendor > 0; n++) {
if ((usbtmc_id_quirk[n].idVendor == data->usb_dev->descriptor.idVendor) && if ((usbtmc_id_quirk[n].idVendor == le16_to_cpu(data->usb_dev->descriptor.idVendor)) &&
(usbtmc_id_quirk[n].idProduct == data->usb_dev->descriptor.idProduct)) { (usbtmc_id_quirk[n].idProduct == le16_to_cpu(data->usb_dev->descriptor.idProduct))) {
dev_dbg(&intf->dev, "Setting this device as having the RIGOL quirk\n"); dev_dbg(&intf->dev, "Setting this device as having the RIGOL quirk\n");
data->rigol_quirk = 1; data->rigol_quirk = 1;
break; break;
......
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