public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.6 probe.c "pcibus_class" Device Class, release function
@ 2004-02-03 22:33 John Rose
  2004-02-04  1:31 ` Matthew Dobson
  0 siblings, 1 reply; 6+ messages in thread
From: John Rose @ 2004-02-03 22:33 UTC (permalink / raw)
  To: colpatch, greg KH, lkml

The function release_pcibus_dev() in probe.c defines the release procedure for
device class pcibus_class.  I want to suggest that this function be scrapped :)

This release function is called in the code path of class_device_unregister().
The pcibus_class devices aren't currently unregistered anywhere, from what I
can tell, so this release function is currently unused.  The runtime removal of
PCI buses from logical partitions on PPC64 requires the unregistration of these
class devices.  The natural place to do this IMHO is in pci_remove_bus_device()
in remove.c.  

The problem is that this calls pci_destroy_dev(), which calls put() on the same
"bridge" device that the release function does.  This should only be done once
in the course of removing a pci_bus, and I doubt that we want to change
pci_destroy_dev().   The kfree() of the pci_bus struct is also done in both
pci_remove_bus_device() and release_pcibus_dev().  

So the only two operations in the release function are redundantly performed in
the place where it makes sense to unregister.  For these reasons, I think we
should scrap the release function altogether and set that pointer in the struct
class to NULL.

Thoughts?
John


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-02-04 18:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-03 22:33 2.6 probe.c "pcibus_class" Device Class, release function John Rose
2004-02-04  1:31 ` Matthew Dobson
2004-02-04 16:00   ` John Rose
2004-02-04 16:05     ` John Rose
2004-02-04 17:22       ` John Rose
2004-02-04 18:01   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox