diff options
Diffstat (limited to 'drivers/usb/dwc3/ep0.c')
-rw-r--r-- | drivers/usb/dwc3/ep0.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 2f51de57593a..24137d8563c9 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c | |||
@@ -309,7 +309,7 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc, | |||
309 | dep = dwc->eps[0]; | 309 | dep = dwc->eps[0]; |
310 | dwc->ep0_usb_req.dep = dep; | 310 | dwc->ep0_usb_req.dep = dep; |
311 | dwc->ep0_usb_req.request.length = sizeof(*response_pkt); | 311 | dwc->ep0_usb_req.request.length = sizeof(*response_pkt); |
312 | dwc->ep0_usb_req.request.dma = dwc->setup_buf_addr; | 312 | dwc->ep0_usb_req.request.buf = dwc->setup_buf; |
313 | dwc->ep0_usb_req.request.complete = dwc3_ep0_status_cmpl; | 313 | dwc->ep0_usb_req.request.complete = dwc3_ep0_status_cmpl; |
314 | 314 | ||
315 | return __dwc3_gadget_ep0_queue(dep, &dwc->ep0_usb_req); | 315 | return __dwc3_gadget_ep0_queue(dep, &dwc->ep0_usb_req); |
@@ -686,7 +686,12 @@ static void dwc3_ep0_do_control_data(struct dwc3 *dwc, | |||
686 | DWC3_TRBCTL_CONTROL_DATA); | 686 | DWC3_TRBCTL_CONTROL_DATA); |
687 | } else if ((req->request.length % dep->endpoint.maxpacket) | 687 | } else if ((req->request.length % dep->endpoint.maxpacket) |
688 | && (event->endpoint_number == 0)) { | 688 | && (event->endpoint_number == 0)) { |
689 | dwc3_map_buffer_to_dma(req); | 689 | ret = usb_gadget_map_request(&dwc->gadget, &req->request, |
690 | event->endpoint_number); | ||
691 | if (ret) { | ||
692 | dev_dbg(dwc->dev, "failed to map request\n"); | ||
693 | return; | ||
694 | } | ||
690 | 695 | ||
691 | WARN_ON(req->request.length > dep->endpoint.maxpacket); | 696 | WARN_ON(req->request.length > dep->endpoint.maxpacket); |
692 | 697 | ||
@@ -701,7 +706,12 @@ static void dwc3_ep0_do_control_data(struct dwc3 *dwc, | |||
701 | dwc->ep0_bounce_addr, dep->endpoint.maxpacket, | 706 | dwc->ep0_bounce_addr, dep->endpoint.maxpacket, |
702 | DWC3_TRBCTL_CONTROL_DATA); | 707 | DWC3_TRBCTL_CONTROL_DATA); |
703 | } else { | 708 | } else { |
704 | dwc3_map_buffer_to_dma(req); | 709 | ret = usb_gadget_map_request(&dwc->gadget, &req->request, |
710 | event->endpoint_number); | ||
711 | if (ret) { | ||
712 | dev_dbg(dwc->dev, "failed to map request\n"); | ||
713 | return; | ||
714 | } | ||
705 | 715 | ||
706 | ret = dwc3_ep0_start_trans(dwc, event->endpoint_number, | 716 | ret = dwc3_ep0_start_trans(dwc, event->endpoint_number, |
707 | req->request.dma, req->request.length, | 717 | req->request.dma, req->request.length, |