/* This function also removes requests which are currently processed ny the hardware and those which are not yet scheduled. Caller should take care of locking.  */
static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep)
/* This function also removes requests which are currently processed ny the hardware and those which are not yet scheduled. Caller should take care of locking.  */
static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep)
{
	struct dwc3		*dwc = dep->dwc;
	u32			reg;
	dwc3_remove_requests(dwc, dep);
	if (dep->flags & DWC3_EP_STALL)
		__dwc3_gadget_ep_set_halt(dep, 0, false);
	reg = dwc3_readl(dwc->regs, DWC3_DALEPENA);
	reg &= ~DWC3_DALEPENA_EP(dep->number);
	dwc3_writel(dwc->regs, DWC3_DALEPENA, reg);
	dep->stream_capable = false;
	dep->endpoint.desc = NULL;
	dep->comp_desc = NULL;
	dep->type = 0;
	dep->flags = 0;
	return 0;
}