/* this will take the oldest urb from an anchor, unanchor and return it  */
struct urb* usb_get_from_anchor(struct usb_anchor *anchor)
/* this will take the oldest urb from an anchor, unanchor and return it  */
struct urb* usb_get_from_anchor(struct usb_anchor *anchor)
{
	struct urb *victim;
	unsigned long flags;
	spin_lock_irqsave(&anchor->lock, flags);
	if (!list_empty(&anchor->urb_list)) {
		victim = list_entry(anchor->urb_list.next, struct urb,
				    anchor_list);
		usb_get_urb(victim);
		spin_unlock_irqrestore(&anchor->lock, flags);
		usb_unanchor_urb(victim);
	} else {
		spin_unlock_irqrestore(&anchor->lock, flags);
		victim = NULL;
	}
	return victim;
}