On Thu, Aug 22, 2024 at 5:24 PM Marek Vasut <ma...@denx.de> wrote: > > Can you change the g_dnl_register() prototype and pass he structure in ? > I suspect it should be available in the commands which register g_dnl ? >
There are many places where g_dnl_register() is called, like fastboot, dfu, ums, etc, need to modify all of them ? > > This is no good, this is a workaround, let's not do this. > You mean which part, order change or disconnect call ? Is there a fixed order of udc_start (device init) and driver->bind ? In non-DM mode most device drivers do init first in their usb_gadget_register_driver(), except udc-core and DWC2 who does driver->bind first. Call usb_gadget_disconnect here could avoid modifying all device driver's init.