summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2020-07-21 10:46:04 +0200
committerMarek Vasut <marex@denx.de>2020-08-05 09:30:46 +0200
commitd96f6e1c0b49eb94f78b662e828e557ba943ee54 (patch)
tree5eeeb748e1e93f075173e901ef65a5c60e6328ac /drivers
parent61a1acb55e8e1da71c1c9a0046942b4a945e444c (diff)
downloadu-boot-d96f6e1c0b49eb94f78b662e828e557ba943ee54.tar.gz
usb: usb-uclass.c: Drop le16_to_cpu() as values are already swapped
These values are already swapped to CPU endianess, so swapping them again is a bug. Let's remove the swap here instead. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/usb-uclass.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index f42c0625cb..e5dda79b94 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -416,21 +416,21 @@ static int usb_match_device(const struct usb_device_descriptor *desc,
const struct usb_device_id *id)
{
if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) &&
- id->idVendor != le16_to_cpu(desc->idVendor))
+ id->idVendor != desc->idVendor)
return 0;
if ((id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) &&
- id->idProduct != le16_to_cpu(desc->idProduct))
+ id->idProduct != desc->idProduct)
return 0;
/* No need to test id->bcdDevice_lo != 0, since 0 is never
greater than any unsigned number. */
if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) &&
- (id->bcdDevice_lo > le16_to_cpu(desc->bcdDevice)))
+ (id->bcdDevice_lo > desc->bcdDevice))
return 0;
if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) &&
- (id->bcdDevice_hi < le16_to_cpu(desc->bcdDevice)))
+ (id->bcdDevice_hi < desc->bcdDevice))
return 0;
if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) &&