/* Returns 1 if a complete packet is available, 0 if not, -EOPNOTSUPP for IN ep.  */
static int epout_has_pkt(struct pxa_ep *ep)
/* Returns 1 if a complete packet is available, 0 if not, -EOPNOTSUPP for IN ep.  */
static int epout_has_pkt(struct pxa_ep *ep)
{
	if (!is_ep0(ep) && ep->dir_in)
		return -EOPNOTSUPP;
	if (is_ep0(ep))
		return (udc_ep_readl(ep, UDCCSR) & UDCCSR0_OPC);
	return (udc_ep_readl(ep, UDCCSR) & UDCCSR_PC);
}