diff options
Diffstat (limited to 'drivers/usb/gadget/udc/udc-uclass.c')
-rw-r--r-- | drivers/usb/gadget/udc/udc-uclass.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/gadget/udc/udc-uclass.c b/drivers/usb/gadget/udc/udc-uclass.c index 062051857a..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) @@ -20,7 +21,7 @@ int usb_gadget_initialize(int index) return -EINVAL; if (dev_array[index]) return 0; - ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, index, &dev); + ret = uclass_get_device_by_seq(UCLASS_USB_GADGET_GENERIC, index, &dev); if (!dev || ret) { pr_err("No USB device found\n"); return -ENODEV; @@ -51,8 +52,10 @@ 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, - .name = "usb_gadget_generic", + .name = "usb", + .flags = DM_UC_FLAG_SEQ_ALIAS, }; |