On 1/28/26 11:50 PM, Jonas Karlman wrote:

+static int dwc2_udc_otg_bind(struct udevice *dev)
+{
+       enum usb_dr_mode dr_mode = usb_get_dr_mode(dev_ofnode(dev));
+
+       if (dr_mode != USB_DR_MODE_PERIPHERAL && dr_mode != USB_DR_MODE_OTG) {
+               dev_dbg(dev, "Invalid mode\n");

Please print the mode while at it.

+               return -ENODEV;
+       }
+
+       return 0;
+}
+
  static int dwc2_gadget_handle_interrupts(struct udevice *dev)
  {
        return dwc2_udc_handle_interrupt();
@@ -1186,6 +1192,7 @@ U_BOOT_DRIVER(dwc2_udc_otg) = {
        .of_match = dwc2_udc_otg_ids,
        .ops    = &dwc2_gadget_ops,
        .of_to_plat = dwc2_udc_otg_of_to_plat,
+       .bind = dwc2_udc_otg_bind,
        .probe = dwc2_udc_otg_probe,
        .remove = dwc2_udc_otg_remove,
        .plat_auto      = sizeof(struct dwc2_plat_otg_data),

The rest looks good, thanks !

Reply via email to