Re: device_unregister_wait() discarded?

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

 



On Thu, Feb 19, 2004 at 07:34:18PM +0100, Frank A. Uepping wrote:
> Hi,
> with the kernel-2.6.3 device_unregister_wait() has been discarded, why?

Because it is wrong to do in "general".

> I regard this function as essential for virtual busses as its device-drivers 
> usually create/own the device structs; consequently the struct 
> device::release() callback is located in the device-driver module.

True.

> In such an environment calling device_unregister() is causing trouble, if 
> someone is still holding a reference to the device and the module is getting 
> unloaded.

Yup, that's why you need to handle the module reference counting for
such situations yourself.  Relying on the _wait() functions to do this
for you is wrong.

Please see the thread on lkml by Linus about why he wanted these
functions removed from the kernel tree for more information.

thanks,

greg k-h

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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