Understanding the LDM: Removing a device's parent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux