diff options
author | Pratyush Anand <pratyush.anand@st.com> | 2012-06-25 22:40:43 +0530 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-07-02 10:02:07 +0300 |
commit | 08f0d96670c53898b4154e7945e77cdd966003f7 (patch) | |
tree | 52dca96f5bef8c30131cd9b653be603b2f59fc7d /drivers/usb/dwc3/gadget.c | |
parent | 5c81ababecd7ddae08ca944a65d8030cd393013c (diff) |
usb: dwc3: correct set_halt implementation for ep0
set_halt for ep0 is called to stall a deferred control responses by the
gadget. We already have a function to stall default control endpoint.
This patch points set_halt for ep0 to the already available function.
Signed-off-by: Pratyush Anand <pratyush.anand@st.com>
Signed-off-by: Michel Sanches <michel.sanches@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index d98549a7b8b..13f257db243 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1268,7 +1268,10 @@ static int dwc3_gadget_ep_set_wedge(struct usb_ep *ep) dep->flags |= DWC3_EP_WEDGE; spin_unlock_irqrestore(&dwc->lock, flags); - return dwc3_gadget_ep_set_halt(ep, 1); + if (dep->number == 0 || dep->number == 1) + return dwc3_gadget_ep0_set_halt(ep, 1); + else + return dwc3_gadget_ep_set_halt(ep, 1); } /* -------------------------------------------------------------------------- */ @@ -1286,7 +1289,7 @@ static const struct usb_ep_ops dwc3_gadget_ep0_ops = { .free_request = dwc3_gadget_ep_free_request, .queue = dwc3_gadget_ep0_queue, .dequeue = dwc3_gadget_ep_dequeue, - .set_halt = dwc3_gadget_ep_set_halt, + .set_halt = dwc3_gadget_ep0_set_halt, .set_wedge = dwc3_gadget_ep_set_wedge, }; |