> > And now looking back at kobj code and device code, they do refcount > parent objects. Maybe the problem is in our side -- the all devices > are created with the original real device as the parent, including the > card_dev, while there are some dependencies among children. So, if we > build up a proper tree, pci_dev -> card_dev -> ctl_dev, pcm_dev, etc, > one of the problems could be solved. It's more or less similar as > what I suggested initially (referring card_dev at pcm), while changing > the parent would make it implicitly. Yes I think this would be the long term proper way to go, that way parents just put children and remove their reference, then they cleanup on their own time making everyone happy. My first patch was a very lazy attempt that, if we wanted to do the right thing we would obviously have to split the structs and free functions to operate in their own release. If you have time feel free to take another swing at the patches, otherwise I won't be able to start until next week. Curtis