Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05eac910 authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by Greg Kroah-Hartman
Browse files

USB: r8a66597-hcd: fix endian problem



Fixed the problem that does not work in the big endian machine.

Signed-off-by: default avatarYoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e3a09051
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -834,7 +834,7 @@ static void init_pipe_info(struct r8a66597 *r8a66597, struct urb *urb,
	info.pipenum = get_empty_pipenum(r8a66597, ep);
	info.pipenum = get_empty_pipenum(r8a66597, ep);
	info.address = get_urb_to_r8a66597_addr(r8a66597, urb);
	info.address = get_urb_to_r8a66597_addr(r8a66597, urb);
	info.epnum = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
	info.epnum = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
	info.maxpacket = ep->wMaxPacketSize;
	info.maxpacket = le16_to_cpu(ep->wMaxPacketSize);
	info.type = get_r8a66597_type(ep->bmAttributes
	info.type = get_r8a66597_type(ep->bmAttributes
				      & USB_ENDPOINT_XFERTYPE_MASK);
				      & USB_ENDPOINT_XFERTYPE_MASK);
	info.bufnum = get_bufnum(info.pipenum);
	info.bufnum = get_bufnum(info.pipenum);
@@ -925,7 +925,7 @@ static void prepare_setup_packet(struct r8a66597 *r8a66597,
	r8a66597_write(r8a66597, ~(SIGN | SACK), INTSTS1);
	r8a66597_write(r8a66597, ~(SIGN | SACK), INTSTS1);


	for (i = 0; i < 4; i++) {
	for (i = 0; i < 4; i++) {
		r8a66597_write(r8a66597, p[i], setup_addr);
		r8a66597_write(r8a66597, cpu_to_le16(p[i]), setup_addr);
		setup_addr += 2;
		setup_addr += 2;
	}
	}
	r8a66597_write(r8a66597, SUREQ, DCPCTR);
	r8a66597_write(r8a66597, SUREQ, DCPCTR);
@@ -2027,7 +2027,7 @@ static int r8a66597_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
	case GetPortStatus:
	case GetPortStatus:
		if (wIndex > R8A66597_MAX_ROOT_HUB)
		if (wIndex > R8A66597_MAX_ROOT_HUB)
			goto error;
			goto error;
		*(u32 *)buf = rh->port;
		*(u32 *)buf = cpu_to_le32(rh->port);
		break;
		break;
	case SetPortFeature:
	case SetPortFeature:
		if (wIndex > R8A66597_MAX_ROOT_HUB)
		if (wIndex > R8A66597_MAX_ROOT_HUB)