Skip to content

Commit 1736f2b

Browse files
jhovoldgregkh
authored andcommitted
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: 1ba47da ("uwb: add the i1480 DFU driver") Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ca19dd1 commit 1736f2b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • drivers/uwb/i1480/dfu

drivers/uwb/i1480/dfu/usb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ int i1480_usb_cmd(struct i1480 *i1480, const char *cmd_name, size_t cmd_size)
341341
static
342342
int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id)
343343
{
344+
struct usb_device *udev = interface_to_usbdev(iface);
344345
struct i1480_usb *i1480_usb;
345346
struct i1480 *i1480;
346347
struct device *dev = &iface->dev;
@@ -352,8 +353,8 @@ int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id)
352353
iface->cur_altsetting->desc.bInterfaceNumber);
353354
goto error;
354355
}
355-
if (iface->num_altsetting > 1
356-
&& interface_to_usbdev(iface)->descriptor.idProduct == 0xbabe) {
356+
if (iface->num_altsetting > 1 &&
357+
le16_to_cpu(udev->descriptor.idProduct) == 0xbabe) {
357358
/* Need altsetting #1 [HW QUIRK] or EP1 won't work */
358359
result = usb_set_interface(interface_to_usbdev(iface), 0, 1);
359360
if (result < 0)

0 commit comments

Comments
 (0)