]> git.sur5r.net Git - u-boot/commitdiff
usb: xhci: Handle endianness in xhci_set_configuration()
authorBin Meng <bmeng.cn@gmail.com>
Thu, 24 May 2018 06:40:50 +0000 (23:40 -0700)
committerMarek Vasut <marex@denx.de>
Wed, 30 May 2018 09:59:10 +0000 (11:59 +0200)
In xhci_set_configuration(), 'Context Entries' field in the slot
context was cleared with mask LAST_CTX_MASK, but it should have
taken the endianness into consideration.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
drivers/usb/host/xhci.c

index f9c6bbb9e983419c5d789ab92911c6b90e3b4fd8..9ded14cc3cb7a6703da755d4ded51e91338ecd91 100644 (file)
@@ -536,7 +536,7 @@ static int xhci_set_configuration(struct usb_device *udev)
        /* slot context */
        xhci_slot_copy(ctrl, in_ctx, out_ctx);
        slot_ctx = xhci_get_slot_ctx(ctrl, in_ctx);
-       slot_ctx->dev_info &= ~(LAST_CTX_MASK);
+       slot_ctx->dev_info &= ~(cpu_to_le32(LAST_CTX_MASK));
        slot_ctx->dev_info |= cpu_to_le32(LAST_CTX(max_ep_flag + 1) | 0);
 
        xhci_endpoint_copy(ctrl, in_ctx, out_ctx, 0);