From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Driver Core patches for 2.6.9-rc1
Date: Wed, 25 Aug 2004 15:36:29 -0700 [thread overview]
Message-ID: <10934733893547@kroah.com> (raw)
In-Reply-To: <10934733882615@kroah.com>
ChangeSet 1.1877, 2004/08/25 13:23:54-07:00, johnrose@austin.ibm.com
[PATCH] PCI Hotplug: create pci_remove_bus()
The following patch implements a pci_remove_bus() that can be used by
hotplug drivers for the removal of root buses. It also defines a
release function that frees the device struct for pci_bus->bridge when a
root bus class device is unregistered.
Signed-off-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/pci/probe.c | 6 ++++++
drivers/pci/remove.c | 20 +++++++++++++-------
include/linux/pci.h | 2 +-
3 files changed, 20 insertions(+), 8 deletions(-)
diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c 2004-08-25 14:51:47 -07:00
+++ b/drivers/pci/probe.c 2004-08-25 14:51:47 -07:00
@@ -571,6 +571,11 @@
return PCI_CFG_SPACE_SIZE;
}
+static void pci_release_bus_bridge_dev(struct device *dev)
+{
+ kfree(dev);
+}
+
/*
* Read the config data for a PCI device, sanity-check it
* and fill in the dev structure...
@@ -772,6 +777,7 @@
memset(dev, 0, sizeof(*dev));
dev->parent = parent;
+ dev->release = pci_release_bus_bridge_dev;
sprintf(dev->bus_id, "pci%04x:%02x", pci_domain_nr(b), bus);
device_register(dev);
b->bridge = get_device(dev);
diff -Nru a/drivers/pci/remove.c b/drivers/pci/remove.c
--- a/drivers/pci/remove.c 2004-08-25 14:51:47 -07:00
+++ b/drivers/pci/remove.c 2004-08-25 14:51:47 -07:00
@@ -59,6 +59,18 @@
}
EXPORT_SYMBOL(pci_remove_device_safe);
+void pci_remove_bus(struct pci_bus *b)
+{
+ pci_proc_detach_bus(b);
+
+ spin_lock(&pci_bus_lock);
+ list_del(&b->node);
+ spin_unlock(&pci_bus_lock);
+
+ class_device_unregister(&b->class_dev);
+}
+EXPORT_SYMBOL(pci_remove_bus);
+
/**
* pci_remove_bus_device - remove a PCI device and any children
* @dev: the device to remove
@@ -77,13 +89,7 @@
struct pci_bus *b = dev->subordinate;
pci_remove_behind_bridge(dev);
- pci_proc_detach_bus(b);
-
- spin_lock(&pci_bus_lock);
- list_del(&b->node);
- spin_unlock(&pci_bus_lock);
-
- class_device_unregister(&b->class_dev);
+ pci_remove_bus(b);
dev->subordinate = NULL;
}
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h 2004-08-25 14:51:47 -07:00
+++ b/include/linux/pci.h 2004-08-25 14:51:47 -07:00
@@ -712,7 +712,7 @@
int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);
extern struct pci_dev *pci_dev_get(struct pci_dev *dev);
extern void pci_dev_put(struct pci_dev *dev);
-
+extern void pci_remove_bus(struct pci_bus *b);
extern void pci_remove_bus_device(struct pci_dev *dev);
/* Generic PCI functions exported to card drivers */
next prev parent reply other threads:[~2004-08-25 22:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-25 22:35 [BK PATCH] Driver Core patches for 2.6.9-rc1 Greg KH
2004-08-25 22:36 ` [PATCH] " Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH [this message]
2004-08-26 2:04 ` Benjamin Herrenschmidt
2004-08-26 4:10 ` Greg KH
2004-08-26 12:26 ` Jean Delvare
2004-08-26 23:33 ` Benjamin Herrenschmidt
2004-08-27 10:16 ` Jean Delvare
-- strict thread matches above, loose matches on Subject: below --
2004-08-26 18:15 Margit Schubert-While
[not found] <200408261957.58105.margitsw@t-online.de>
[not found] ` <5.1.0.14.2.20040908220127.02a9daa8@pop.t-online.de>
2004-09-08 20:21 ` 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=10934733893547@kroah.com \
--to=greg@kroah.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