summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2018-12-21 09:50:21 +0100
committerMarek Vasut <marex@denx.de>2019-01-10 18:53:03 +0100
commitb3c518a88278619b1e109de114c450237d03e032 (patch)
tree87d3392c6e54e9cd8dab1c7c143e8f1c87166937 /drivers/usb
parentdb17a92d28bd57dfa550e2d91c594e10dd487c6b (diff)
dm: usb: gadget: Fix boot breakage on sunxi platforms
Fixes commit 013116243950 ("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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/udc/Makefile3
-rw-r--r--drivers/usb/gadget/udc/udc-uclass.c2
2 files changed, 4 insertions, 1 deletions
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 <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,