Hi Felipe, We can use a common is_selfpowered flag at usb_gadget to indicate whether the gadget is self-powered or bus-powered, it can avoid every udc driver defining a similar flag, and the user can read it through udc core sys entry. The changes are based on your testing/test tree, and it passed allmodconfig compile test. And it adds Alan's comments for chipidea/udc.c as well as a bug for spinlock, the changes are tested at chipidea platforms. PS: I find allmodconfig doesn't compile some udcs, like: lpc32xx_udc fsl_udc_core omap_udc at91_udc atmel_usba_udc Do you know how let all udc drivers are compiled? Peter Chen (19): usb: gadget: introduce is_selfpowered for usb_gadget usb: chipidea: udc: add set_selfpowered gaget ops usb: gadget: at91_udc: use common is_selfpowered staging: emxx_udc: use common is_selfpowered usb: renesas_usbhs: gadget: set value for common is_selfpowered usb: gadget: bdc_udc: set value for common is_selfpowered usb: gadget: dummy_hcd: set value for common is_selfpowered usb: gadget: lpc32xx_udc: use common is_selfpowered usb: gadget: fsl_udc_core: set value for common is_selfpowered usb: gadget: omap_udc: set value for common is_selfpowered usb: gadget: r8a66597-udc: set value for common is_selfpowered usb: gadget: net2280: use common is_selfpowered usb: gadget: s3c2410_udc: set value for common is_selfpowered usb: gadget: net2272: use common is_selfpowered usb: gadget: atmel_usba_udc: set value for common is_selfpowered usb: gadget: pch_udc: set value for common is_selfpowered usb: dwc3: gadget: use common is_selfpowered usb: musb: gadget: use common is_selfpowered usb: udc-core: add is_selfpowered sys entry drivers/staging/emxx_udc/emxx_udc.c | 9 +++------ drivers/staging/emxx_udc/emxx_udc.h | 1 - drivers/usb/chipidea/udc.c | 18 ++++++++++++++++-- drivers/usb/dwc3/core.h | 2 -- drivers/usb/dwc3/ep0.c | 2 +- drivers/usb/dwc3/gadget.c | 2 +- drivers/usb/gadget/udc/at91_udc.c | 8 ++++---- drivers/usb/gadget/udc/at91_udc.h | 1 - drivers/usb/gadget/udc/atmel_usba_udc.c | 1 + drivers/usb/gadget/udc/bdc/bdc_udc.c | 1 + drivers/usb/gadget/udc/dummy_hcd.c | 1 + drivers/usb/gadget/udc/fsl_udc_core.c | 3 ++- drivers/usb/gadget/udc/lpc32xx_udc.c | 12 ++++-------- drivers/usb/gadget/udc/net2272.c | 7 ++----- drivers/usb/gadget/udc/net2272.h | 1 - drivers/usb/gadget/udc/net2280.c | 6 +++--- drivers/usb/gadget/udc/net2280.h | 1 - drivers/usb/gadget/udc/omap_udc.c | 1 + drivers/usb/gadget/udc/pch_udc.c | 1 + drivers/usb/gadget/udc/r8a66597-udc.c | 1 + drivers/usb/gadget/udc/s3c2410_udc.c | 1 + drivers/usb/gadget/udc/udc-core.c | 2 ++ drivers/usb/musb/musb_gadget.c | 4 +--- drivers/usb/musb/musb_gadget_ep0.c | 2 +- drivers/usb/renesas_usbhs/mod_gadget.c | 2 ++ include/linux/usb/gadget.h | 2 ++ 26 files changed, 51 insertions(+), 41 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