]> git.baikalelectronics.ru Git - uboot.git/commitdiff
dm: usb: gadget: Fix boot breakage on sunxi platforms
authorJean-Jacques Hiblot <jjhiblot@ti.com>
Fri, 21 Dec 2018 08:50:21 +0000 (09:50 +0100)
committerMarek Vasut <marex@denx.de>
Thu, 10 Jan 2019 17:53:03 +0000 (18:53 +0100)
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 <plaes@plaes.org>
Reported-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Tested-by: Priit Laes <plaes@plaes.org>
Acked-by: Jagan Teki <jagan@openedev.com>
drivers/usb/gadget/udc/Makefile
drivers/usb/gadget/udc/udc-uclass.c

index 38ac2dd475e544ca66659a30b2a1e16552086a03..95dbf0c82ee4246eddbd76d42b40ccbdcd8ac37a 100644 (file)
@@ -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
index e9f8f5f246300dbdb53abcb0b70b5e8e70fea33b..8d7864797a71dacf2dd137e1e8e11284c3f16cb6 100644 (file)
@@ -9,6 +9,7 @@
 #include <dm/device-internal.h>
 #include <linux/usb/gadget.h>
 
+#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,