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

Commit d9b33c60 authored by Felipe Balbi's avatar Felipe Balbi
Browse files

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: default avatarFelipe Balbi <balbi@ti.com>
parent 35f75696
Loading
Loading
Loading
Loading
+11 −1
Original line number Original line Diff line number Diff line
@@ -155,13 +155,23 @@ static int __dwc3_gadget_ep0_queue(struct dwc3_ep *dep,


		dep->flags &= ~(DWC3_EP_PENDING_REQUEST |
		dep->flags &= ~(DWC3_EP_PENDING_REQUEST |
				DWC3_EP0_DIR_IN);
				DWC3_EP0_DIR_IN);
	} else if (dwc->delayed_status) {

		return 0;
	}

	/*
	 * In case gadget driver asked us to delay the STATUS phase,
	 * handle it here.
	 */
	if (dwc->delayed_status) {
		dwc->delayed_status = false;
		dwc->delayed_status = false;


		if (dwc->ep0state == EP0_STATUS_PHASE)
		if (dwc->ep0state == EP0_STATUS_PHASE)
			__dwc3_ep0_do_control_status(dwc, dwc->eps[1]);
			__dwc3_ep0_do_control_status(dwc, dwc->eps[1]);
		else
		else
			dev_dbg(dwc->dev, "too early for delayed status\n");
			dev_dbg(dwc->dev, "too early for delayed status\n");

		return 0;
	}
	}


	return 0;
	return 0;