On Mon, Sep 07, 2020 at 10:48:29AM +0300, Felipe Balbi wrote: > Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> writes: > > Hi, > > > On Fri, Jul 31, 2020 at 02:06:20PM +0000, Peter Chen wrote: > >> > And this no-op function is horrid. There used to be documentation in > >> > the kernel where I could rant about this, but instead, I'll just say, > >> > "why are people trying to work around warnings we put in the core kernel > >> > to fix common problems? Do they think we did that just because we > >> > wanted to be mean???" > >> > > >> > >> So, like kernel doc for device_initialize said, a proper fix for dwc3 > >> should be zeroed gadget device memory at its own driver before the > >> gadget device register to driver core, right? > > > > It should get a totally different, dynamically allocated structure. > > NEVER recycle them. > > then we break usage of container_of(). That's okay, but we have to add > some sort of private_data to the gadget structure so UDC drivers can get > their own pointers back. As you've probably seen by now, Peter solved this problem by storing the private back-pointer in gadget->dev.platform_data. Alan Stern