Hi Felipe, This is the follow-up: http://marc.info/?l=linux-usb&m=140979297227434&w=2. Sorry for late. In the first two patches, we introduce two internal APIs which are used to find corresponding udc according to usb_gadget or usb_gadget_driver, it can simplify the code structure. In the 3rd patch, it maintains flag 'vbus' as vbus status, and try to connect or disconnect gadget according to vbus status. In the 4th patch, it maintains count 'deactivations' for connect or disconnect gadget according to function/user behavior. If you agree with handing dp like above way, I will have two patchset, one for udc driver for 'vbus' and another for function driver for 'deactivations'. Changes for v2: - introduce two internal APIs to simplify the code structure. - Teach patch 3/4 and 4/4 to use the new introduced API. Peter Chen (4): usb: udc: add usb_gadget_find_udc usb: udc: add udc_driver_find_udc usb: udc: add usb_udc_vbus_handler usb: udc: add usb_udc_activation_handler drivers/usb/gadget/udc/udc-core.c | 144 ++++++++++++++++++++++++++++---------- include/linux/usb/gadget.h | 9 +++ 2 files changed, 116 insertions(+), 37 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html