I need a strategy for handling unregistered parent devices.

struct device *parent =  get_ptr_to_parent();
struct device *child = kzalloc ( a device )
child->parent = get_device(parent);
...
device_register(child)

Later on:
struct device *parent =  get_ptr_to_parent();
device_unregister(parent);
/* device_unregister(child) not invoked */

The parent device is not released because my child device is still holding
a reference. In my case, the child device is not useful without the parent
being registered. How can the child receive notification that the parent
has been unregistered? The parent device and child device are being created
by different drivers.

I've been referencing:
http://lxr.free-electrons.com/source/drivers/base/core.c#L1259

Thanks,
--Rick
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to