Re: [patch] IDE driver model update

Patrick Mochel
2002-10-07T23:00:01Z

> > It's the desctrutor for the device object. ->release() is the last thing
> > called when the last reference to the device goes away. That's the only
> > time it's called.
>
> ???
>
> Details, please. When can it happen and what normally holds that object
> pinned?

get_device()/put_device(). When struct device::refcount hits 0, it's
cleaned up. c.f. drivers/base/core.c::put_device().

The bus type that the device belongs to always owns it, and could easily
be put in struct bus_type. Basically, it tells the bus that it's finally
ok to free the structure. That's not done by the driver core, since the
struct device is (so far) always embedded in a bus-specific structure.

Thoughts? Suggestions?

-pat