It is _not_ the earliest we can safely free the data structure.
Dmitry's callback occurs when _all_ the sysfs attributes have been
released -- including ones that don't have anything to do with the
driver's private data structure. Think of the bInterfaceClass attribute,
for example.
But even aside from that, Dmitry's suggestion is wrong. He wants to add a
second release() method to the driver, which can be called from the
subsystem's release() method -- which doesn't run until the device is
unregistered, possibly long after the driver has been unbound from it.
Then how could the subsystem even know which drivers need their second
release method called?
Yeah, I was wrong about that.
I get the picture, thanks.
Alan Stern
-