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

uwb: fix device quirk on big-endian hosts

commit 41318a2b upstream.

Add missing endianness conversion when using the USB device-descriptor
idProduct field to apply a hardware quirk.

Fixes: 1ba47da5 ("uwb: add the i1480 DFU driver")
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 609a3e81
...@@ -341,6 +341,7 @@ int i1480_usb_cmd(struct i1480 *i1480, const char *cmd_name, size_t cmd_size) ...@@ -341,6 +341,7 @@ int i1480_usb_cmd(struct i1480 *i1480, const char *cmd_name, size_t cmd_size)
static static
int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id) 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_usb *i1480_usb;
struct i1480 *i1480; struct i1480 *i1480;
struct device *dev = &iface->dev; struct device *dev = &iface->dev;
...@@ -352,8 +353,8 @@ int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id) ...@@ -352,8 +353,8 @@ int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id)
iface->cur_altsetting->desc.bInterfaceNumber); iface->cur_altsetting->desc.bInterfaceNumber);
goto error; goto error;
} }
if (iface->num_altsetting > 1 if (iface->num_altsetting > 1 &&
&& interface_to_usbdev(iface)->descriptor.idProduct == 0xbabe) { le16_to_cpu(udev->descriptor.idProduct) == 0xbabe) {
/* Need altsetting #1 [HW QUIRK] or EP1 won't work */ /* Need altsetting #1 [HW QUIRK] or EP1 won't work */
result = usb_set_interface(interface_to_usbdev(iface), 0, 1); result = usb_set_interface(interface_to_usbdev(iface), 0, 1);
if (result < 0) if (result < 0)
......
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