/* Detach the URB from active list Usage: backend to remove a URB from active list.  */
static void detach_from_active(usbd_device *dev, usbd_urb *item)
/* Detach the URB from active list Usage: backend to remove a URB from active list.  */
static void detach_from_active(usbd_device *dev, usbd_urb *item)
{
	usbd_urb *urb = dev->urbs.active.head, *prev = NULL;
	while (urb != NULL) {
		if (urb != item) {
			prev = urb;
			urb = urb->next;
			continue;
		}
		queue_item_detach(&dev->urbs.active, prev, urb);
		free_ep_from_urb(dev, urb);
		return;
	}
	LOGF_LN("WARNING: Found not find URB %"PRIu64" in active list to detach it",
		urb->id);
}