On 20.06.2023 18:22, Greg Kroah-Hartman wrote:
Is this structure needed anymore at all now that the thing the kref was "protecting" is gone? I think it can be dropped entirely, right? thanks, greg k-h
As I understood after reading the code, this kref is used for checking how many devices uses our class and testing when we can unregister it.
As we register our class only when the first device is registered, I think the best solution is to move this kref structure out of the usb_class structure as we still need it for detecting when we could finally unregister our class. What do you think about it?