diff options
author | Johan Hovold <johan@kernel.org> | 2017-05-12 06:06:32 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-25 09:44:46 -0400 |
commit | 3fe116563d5ddc2e3a506eb4b227164e5ccaed23 (patch) | |
tree | 4b5f047a3112921bfca27ae1e76387a9a99139ba | |
parent | f157261b55a40a5fe38259d1dcc0a9ff30987b3c (diff) |
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>
-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 6345e85822a4..a50cf45e530f 100644 --- a/drivers/uwb/i1480/dfu/usb.c +++ b/drivers/uwb/i1480/dfu/usb.c | |||
@@ -341,6 +341,7 @@ error_submit_ep1: | |||
341 | static | 341 | static |
342 | int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id) | 342 | int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id) |
343 | { | 343 | { |
344 | struct usb_device *udev = interface_to_usbdev(iface); | ||
344 | struct i1480_usb *i1480_usb; | 345 | struct i1480_usb *i1480_usb; |
345 | struct i1480 *i1480; | 346 | struct i1480 *i1480; |
346 | struct device *dev = &iface->dev; | 347 | struct device *dev = &iface->dev; |
@@ -352,8 +353,8 @@ int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id) | |||
352 | iface->cur_altsetting->desc.bInterfaceNumber); | 353 | iface->cur_altsetting->desc.bInterfaceNumber); |
353 | goto error; | 354 | goto error; |
354 | } | 355 | } |
355 | if (iface->num_altsetting > 1 | 356 | if (iface->num_altsetting > 1 && |
356 | && interface_to_usbdev(iface)->descriptor.idProduct == 0xbabe) { | 357 | le16_to_cpu(udev->descriptor.idProduct) == 0xbabe) { |
357 | /* Need altsetting #1 [HW QUIRK] or EP1 won't work */ | 358 | /* Need altsetting #1 [HW QUIRK] or EP1 won't work */ |
358 | result = usb_set_interface(interface_to_usbdev(iface), 0, 1); | 359 | result = usb_set_interface(interface_to_usbdev(iface), 0, 1); |
359 | if (result < 0) | 360 | if (result < 0) |