/* Checks if there is a new event to handle on the event ring. */
static int event_ready(struct xhci_ctrl *ctrl)
/* Checks if there is a new event to handle on the event ring. */
static int event_ready(struct xhci_ctrl *ctrl)
{
	union xhci_trb *event;
	xhci_inval_cache((uintptr_t)ctrl->event_ring->dequeue,
			 sizeof(union xhci_trb));
	event = ctrl->event_ring->dequeue;
	if ((le32_to_cpu(event->event_cmd.flags) & TRB_CYCLE) !=
		ctrl->event_ring->cycle_state)
		return 0;
	return 1;
}