From: Pawel Laszczak Date: Thu, 10 Dec 2020 16:22:58 +0000 (+0100) Subject: usb: cdnsp: Fix for undefined reference to `usb_hcd_is_primary_hcd' X-Git-Tag: howlett/maple/20220722_2~3799^2~23^2~4 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=826a9584d14a7561f44eac86fe7d3c75c6bd2ad9;p=users%2Fjedix%2Flinux-maple.git usb: cdnsp: Fix for undefined reference to `usb_hcd_is_primary_hcd' Patch fixes the following compilation error: ld: drivers/usb/cdns3/host.o: in function `xhci_cdns3_suspend_quirk': host.c:(.text+0x9): undefined reference to `usb_hcd_is_primary_hcd' This reference to 'usb_hdc_is_primary_hcd' is from hcd_to_xhci(), which is being built as a loadable module: int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd) { struct xhci_hcd *xhci = hcd_to_xhci(hcd); Issue occurrd for following kernel configuration: CONFIG_USB_GADGET=y CONFIG_USB_SUPPORT=y CONFIG_USB_COMMON=y CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB=m CONFIG_USB_CDNS_SUPPORT=y CONFIG_USB_CDNS_HOST=y CONFIG_USB_CDNS3=m CONFIG_USB_CDNS3_GADGET=y CONFIG_USB_CDNS3_HOST=y Signed-off-by: Pawel Laszczak Reported-by: Randy Dunlap Acked-by: Randy Dunlap # build-tested Signed-off-by: Peter Chen --- diff --git a/drivers/usb/cdns3/Makefile b/drivers/usb/cdns3/Makefile index 01a9a9620044..3f9b7fa8a594 100644 --- a/drivers/usb/cdns3/Makefile +++ b/drivers/usb/cdns3/Makefile @@ -6,8 +6,13 @@ CFLAGS_cdnsp-trace.o := -I$(src) cdns-usb-common-y := core.o drd.o cdns3-y := cdns3-plat.o -obj-$(CONFIG_USB_CDNS3) += cdns3.o +ifeq ($(CONFIG_USB),m) +obj-m += cdns-usb-common.o +obj-m += cdns3.o +else obj-$(CONFIG_USB_CDNS_SUPPORT) += cdns-usb-common.o +obj-$(CONFIG_USB_CDNS3) += cdns3.o +endif cdns-usb-common-$(CONFIG_USB_CDNS_HOST) += host.o cdns3-$(CONFIG_USB_CDNS3_GADGET) += cdns3-gadget.o cdns3-ep0.o