/* This, will call usb_gadget_unregister_driver() if the @udc is still busy.  */
void usb_del_gadget_udc(struct usb_gadget *gadget)
/* This, will call usb_gadget_unregister_driver() if the @udc is still busy.  */
void usb_del_gadget_udc(struct usb_gadget *gadget)
{
	struct usb_udc		*udc = NULL;
	mutex_lock(&udc_lock);
	list_for_each_entry(udc, &udc_list, list)
		if (udc->gadget == gadget)
			goto found;
	dev_err(gadget->dev.parent, "gadget not registered.\n");
	mutex_unlock(&udc_lock);
	return;
found:
	dev_vdbg(gadget->dev.parent, "unregistering gadget\n");
	list_del(&udc->list);
	mutex_unlock(&udc_lock);
	if (udc->driver)
		usb_gadget_remove_driver(udc);
}