On Wed, Jun 21, 2023 at 05:06:34PM +0400, Ivan Orlov wrote: > On 6/21/23 16:48, Greg Kroah-Hartman wrote: > > I think we should make it simpler, allocate the class when we start up, > > and free it when we shut down, which guarantees that all users of the > > class are removed at that time as this is part of the usb core code. > > > > No need to be fancy anymore with the dynamic creation/removal of the > > class, it's just not worth it :) > > > > thanks, > > > > greg k-h > > Alright, it sounds really reasonable, let's do it in this way :) > > I'll add init_usb_class call to the 'usb_init' function and the > corresponding releasing function call to the 'usb_exit' function in the > 'drivers/usb/core/usb.c' file. So we would register class at startup and > unregister it when shutting down. > Totally reasonable, thanks for doing this work. greg k-h