Hi Felipe, On Thu, May 9, 2013 at 8:18 PM, Felipe Balbi <balbi@xxxxxx> wrote: > Hi, > > On Wed, May 08, 2013 at 10:04:56PM +0530, Vivek Gautam wrote: >> Commit 388e5c51135f817f01177c42261f1116a6d7f2ad usb: dwc3: remove >> dwc3 dependency on host AND gadget >> by me breaks compilation when USB_DWC3=y, USB=y but USB_GADGET=m, >> additionally when either of USB_DWC3_GADGET=y or USB_DWC3_DUAL_ROLE=y >> :-( >> >> I had some confusion with this actually. >> >> We started with making USB_DWC3 independent of USB and USB_GADGET. >> Thereby added some helping configs USB_DWC3_HOST, USB_DWC3_GADGET and >> USB_DWC3_DUAL_ROLE. >> Now when USB_GADGET=m and USB=y; USB_DWC3=y >> Now, USB_DWC3_DUAL_ROLE=y or USB_DWC3_GADGET=y will make things >> worse, since it will compile >> dwc3/gadget.c and dwc3/ep0.c >> This lets the compilation to break since usb/gadget/** is still >> compiling as module. >> But the errors it throws for functions are already exported with >> EXPORT_SYMBOL_GPL(), then why these errors then. >> >> A possible flaw with this could be that "USB_DWC3_HOST, >> USB_DWC3_GADGET and USB_DWC3_DUAL_ROLE" >> are still 'bool' type configs. But making this as 'tristate' too >> doesn't makes our life easier. >> Ideally dwc3/gadget.c and dwc3/ep0.c should be compiling as modules >> when USB_GADGET=m. >> But then we have functions like dwc3_host_init() and >> dwc3_gadget_init() and other similar functions in dwc3/core.c which >> give >> compilation break. >> >> Help please !!!! :-) > > I guess we need to make USB_GADGET bool then. udc-core would always be > built-in or not built at all. Can you see if that helps ? True, this definitely helps. Thanks !! But i was worrying do we really want to do this :-( I could come with below change too (although seems a bit silly, adding a dummy config and stuff :-( ) ____________________________________________________________ diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig index ea5ee9c..f5fbfe1 100644 --- a/drivers/usb/dwc3/Kconfig +++ b/drivers/usb/dwc3/Kconfig @@ -1,6 +1,11 @@ config USB_DWC3 + bool "DesignWare USB3 DRD controller" + depends on (USB || USB_GADGET) + +if USB_DWC3 +config USB_DWC3_CORE tristate "DesignWare USB3 DRD Core Support" - depends on (USB || USB_GADGET) && GENERIC_HARDIRQS + depends on (USB && USB_GADGET) && GENERIC_HARDIRQS select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD help Say Y or M here if your system has a Dual Role SuperSpeed @@ -9,7 +14,7 @@ config USB_DWC3 If you choose to build this driver is a dynamically linked module, the module will be called dwc3.ko. -if USB_DWC3 +if USB_DWC3_CORE choice bool "DWC3 Mode Selection" @@ -51,4 +56,5 @@ config USB_DWC3_VERBOSE help Say Y here to enable verbose debugging messages on DWC3 Driver. -endif +endif # USB_DWC3_CORE +endif # USB_DWC3 diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile index 0c7ac92..7073ae5 100644 --- a/drivers/usb/dwc3/Makefile +++ b/drivers/usb/dwc3/Makefile @@ -1,7 +1,7 @@ ccflags-$(CONFIG_USB_DWC3_DEBUG) := -DDEBUG ccflags-$(CONFIG_USB_DWC3_VERBOSE) += -DVERBOSE_DEBUG -obj-$(CONFIG_USB_DWC3) += dwc3.o +obj-$(CONFIG_USB_DWC3_CORE) += dwc3.o dwc3-y := core.o _______________________________________________________________ Can this be a possible solution to the issue ? -- Best Regards Vivek -- 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