hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/usb/gadget/udc/fotg210-udc.c
....@@ -629,10 +629,10 @@
629629 static void fotg210_set_address(struct fotg210_udc *fotg210,
630630 struct usb_ctrlrequest *ctrl)
631631 {
632
- if (ctrl->wValue >= 0x0100) {
632
+ if (le16_to_cpu(ctrl->wValue) >= 0x0100) {
633633 fotg210_request_error(fotg210);
634634 } else {
635
- fotg210_set_dev_addr(fotg210, ctrl->wValue);
635
+ fotg210_set_dev_addr(fotg210, le16_to_cpu(ctrl->wValue));
636636 fotg210_set_cxdone(fotg210);
637637 }
638638 }
....@@ -713,17 +713,17 @@
713713
714714 switch (ctrl->bRequestType & USB_RECIP_MASK) {
715715 case USB_RECIP_DEVICE:
716
- fotg210->ep0_data = 1 << USB_DEVICE_SELF_POWERED;
716
+ fotg210->ep0_data = cpu_to_le16(1 << USB_DEVICE_SELF_POWERED);
717717 break;
718718 case USB_RECIP_INTERFACE:
719
- fotg210->ep0_data = 0;
719
+ fotg210->ep0_data = cpu_to_le16(0);
720720 break;
721721 case USB_RECIP_ENDPOINT:
722722 epnum = ctrl->wIndex & USB_ENDPOINT_NUMBER_MASK;
723723 if (epnum)
724724 fotg210->ep0_data =
725
- fotg210_is_epnstall(fotg210->ep[epnum])
726
- << USB_ENDPOINT_HALT;
725
+ cpu_to_le16(fotg210_is_epnstall(fotg210->ep[epnum])
726
+ << USB_ENDPOINT_HALT);
727727 else
728728 fotg210_request_error(fotg210);
729729 break;