diff options
author | Felipe Balbi <balbi@ti.com> | 2012-07-19 01:51:13 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-08-03 02:28:24 -0400 |
commit | d9b33c605c398df1d42c694bda28fe8708754c64 (patch) | |
tree | cb695c31b991cebd475c8d9e75cbaa3bdfd87a2b /drivers/usb/dwc3 | |
parent | 35f75696649d43aee8031d81783322b0708805b5 (diff) |
usb: dwc3: ep0: split the special cases on ep0_queue
We can return early from each if () branch
and split the special cases for clarity. While
at that also add a comment to the delayed_status
case.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r-- | drivers/usb/dwc3/ep0.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 962fb9b5465..28bce9be30b 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c | |||
@@ -155,13 +155,23 @@ static int __dwc3_gadget_ep0_queue(struct dwc3_ep *dep, | |||
155 | 155 | ||
156 | dep->flags &= ~(DWC3_EP_PENDING_REQUEST | | 156 | dep->flags &= ~(DWC3_EP_PENDING_REQUEST | |
157 | DWC3_EP0_DIR_IN); | 157 | DWC3_EP0_DIR_IN); |
158 | } else if (dwc->delayed_status) { | 158 | |
159 | return 0; | ||
160 | } | ||
161 | |||
162 | /* | ||
163 | * In case gadget driver asked us to delay the STATUS phase, | ||
164 | * handle it here. | ||
165 | */ | ||
166 | if (dwc->delayed_status) { | ||
159 | dwc->delayed_status = false; | 167 | dwc->delayed_status = false; |
160 | 168 | ||
161 | if (dwc->ep0state == EP0_STATUS_PHASE) | 169 | if (dwc->ep0state == EP0_STATUS_PHASE) |
162 | __dwc3_ep0_do_control_status(dwc, dwc->eps[1]); | 170 | __dwc3_ep0_do_control_status(dwc, dwc->eps[1]); |
163 | else | 171 | else |
164 | dev_dbg(dwc->dev, "too early for delayed status\n"); | 172 | dev_dbg(dwc->dev, "too early for delayed status\n"); |
173 | |||
174 | return 0; | ||
165 | } | 175 | } |
166 | 176 | ||
167 | return 0; | 177 | return 0; |