From: John Rose <johnrose@austin.ibm.com>
To: colpatch@us.ibm.com, greg KH <gregkh@us.ibm.com>,
lkml <linux-kernel@vger.kernel.org>
Subject: 2.6 probe.c "pcibus_class" Device Class, release function
Date: Tue, 03 Feb 2004 16:33:39 -0600 [thread overview]
Message-ID: <1075847619.28337.31.camel@verve> (raw)
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
next reply other threads:[~2004-02-03 22:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-03 22:33 John Rose [this message]
2004-02-04 1:31 ` 2.6 probe.c "pcibus_class" Device Class, release function 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1075847619.28337.31.camel@verve \
--to=johnrose@austin.ibm.com \
--cc=colpatch@us.ibm.com \
--cc=gregkh@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox