From: Jean-Jacques Hiblot Date: Fri, 21 Dec 2018 08:50:21 +0000 (+0100) Subject: dm: usb: gadget: Fix boot breakage on sunxi platforms X-Git-Tag: baikal/mips/sdk5.9~1175^2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=c4f0eaac2f81672705127919bd311ba788d8afeb;p=uboot.git dm: usb: gadget: Fix boot breakage on sunxi platforms Fixes commit 182a51d6a74d ("dm: usb: create a new UCLASS ID for USB gadget devices") The UCLASS_DRIVER for id UCLASS_USB_GADGET_GENERIC needs to be declared even for platforms that do not enable DM_USB_GADGET. Otherwise the driver for their usb peripheral controller fails to bind. Reported-by: Priit Laes Reported-by: Jagan Teki Signed-off-by: Jean-Jacques Hiblot Tested-by: Priit Laes Acked-by: Jagan Teki --- diff --git a/drivers/usb/gadget/udc/Makefile b/drivers/usb/gadget/udc/Makefile index 38ac2dd475..95dbf0c82e 100644 --- a/drivers/usb/gadget/udc/Makefile +++ b/drivers/usb/gadget/udc/Makefile @@ -6,4 +6,5 @@ ifndef CONFIG_$(SPL_)DM_USB_GADGET obj-$(CONFIG_USB_DWC3_GADGET) += udc-core.o endif -obj-$(CONFIG_$(SPL_)DM_USB_GADGET) += udc-uclass.o udc-core.o +obj-$(CONFIG_$(SPL_)DM_USB_GADGET) += udc-core.o +obj-$(CONFIG_$(SPL_)DM) += udc-uclass.o diff --git a/drivers/usb/gadget/udc/udc-uclass.c b/drivers/usb/gadget/udc/udc-uclass.c index e9f8f5f246..8d7864797a 100644 --- a/drivers/usb/gadget/udc/udc-uclass.c +++ b/drivers/usb/gadget/udc/udc-uclass.c @@ -9,6 +9,7 @@ #include #include +#if CONFIG_IS_ENABLED(DM_USB_GADGET) #define MAX_UDC_DEVICES 4 static struct udevice *dev_array[MAX_UDC_DEVICES]; int usb_gadget_initialize(int index) @@ -51,6 +52,7 @@ int usb_gadget_handle_interrupts(int index) return -EINVAL; return dm_usb_gadget_handle_interrupts(dev_array[index]); } +#endif UCLASS_DRIVER(usb_gadget_generic) = { .id = UCLASS_USB_GADGET_GENERIC,