diff options
author | Johan Hovold <johan@kernel.org> | 2017-05-12 13:06:32 +0300 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2017-09-15 20:30:42 +0300 |
commit | 8e88603e7b51fc8929ae1de31072d499b595a321 (patch) | |
tree | 19f83201c7586f3f883127a3d7ff23a89ae84dc1 | |
parent | 057747d4f85d37025224b302ec5ac3057b473f22 (diff) | |
download | linux-8e88603e7b51fc8929ae1de31072d499b595a321.tar.xz |
uwb: fix device quirk on big-endian hosts
commit 41318a2b82f5d5fe1fb408f6d6e0b22aa557111d upstream.
Add missing endianness conversion when using the USB device-descriptor
idProduct field to apply a hardware quirk.
Fixes: 1ba47da52712 ("uwb: add the i1480 DFU driver")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | drivers/uwb/i1480/dfu/usb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/uwb/i1480/dfu/usb.c b/drivers/uwb/i1480/dfu/usb.c index b71291b5056f..a0102f802abb 100644 --- a/drivers/uwb/i1480/dfu/usb.c +++ b/drivers/uwb/i1480/dfu/usb.c @@ -341,6 +341,7 @@ error_submit_ep1: static int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id) { + struct usb_device *udev = interface_to_usbdev(iface); struct i1480_usb *i1480_usb; struct i1480 *i1480; struct device *dev = &iface->dev; @@ -352,8 +353,8 @@ int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id) iface->cur_altsetting->desc.bInterfaceNumber); goto error; } - if (iface->num_altsetting > 1 - && interface_to_usbdev(iface)->descriptor.idProduct == 0xbabe) { + if (iface->num_altsetting > 1 && + le16_to_cpu(udev->descriptor.idProduct) == 0xbabe) { /* Need altsetting #1 [HW QUIRK] or EP1 won't work */ result = usb_set_interface(interface_to_usbdev(iface), 0, 1); if (result < 0) |