<div dir="ltr"><div>I need a strategy for handling unregistered parent devices. </div><div><br></div><div>struct device *parent =  get_ptr_to_parent();<br></div><div>struct device *child = kzalloc ( a device )</div><div>child-&gt;parent = get_device(parent);</div>
<div>...</div><div>device_register(child)</div><div><br></div><div>Later on:</div><div>struct device *parent =  get_ptr_to_parent();</div><div>device_unregister(parent);</div><div>/* device_unregister(child) not invoked */</div>
<div><br></div><div>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. </div>
<div><br></div><div>I&#39;ve been referencing:</div><div><a href="http://lxr.free-electrons.com/source/drivers/base/core.c#L1259">http://lxr.free-electrons.com/source/drivers/base/core.c#L1259</a><br></div><div><br></div>
<div>Thanks,</div><div>--Rick</div><div><br></div><div><br></div></div>