aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/rpadlpar_core.c
diff options
context:
space:
mode:
authorJohn Rose <johnrose@austin.ibm.com>2005-07-25 12:13:38 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-08 17:57:22 -0400
commit9c209c919df95f83aa042b3352c43841ad15a02b (patch)
tree9be41a91d2da30893cc4e5b88fa02ea36f756598 /drivers/pci/hotplug/rpadlpar_core.c
parent5eeb8c63a38ff20285f3bbe7bcfe5e7c33c8ba14 (diff)
[PATCH] PCI Hotplug: rpaphp: Change slot pci reference
The slot structure in the rpaphp module currently references the PCI contents of the slot using the PCI device of the parent bridge. This is unnecessary, since the module is actually interested in the subordinate bus of the bridge. The dependency on a PCI bridge device also prohibits the module from registering hotplug slots that have a root bridge as a parent, since root bridges on PPC64 don't have PCI devices. This patch changes struct slot to reference the PCI subsystem using a pci_bus rather than a pci_dev. Signed-off-by: John Rose <johnrose@austin.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/rpadlpar_core.c')
-rw-r--r--drivers/pci/hotplug/rpadlpar_core.c44
1 files changed, 8 insertions, 36 deletions
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index d7f1319f167a..7f868edaa72d 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -198,28 +198,6 @@ static struct pci_dev *dlpar_pci_add_bus(struct device_node *dn)
198 return dev; 198 return dev;
199} 199}
200 200
201static int dlpar_pci_remove_bus(struct pci_dev *bridge_dev)
202{
203 struct pci_bus *secondary_bus;
204
205 if (!bridge_dev) {
206 printk(KERN_ERR "%s: unexpected null device\n",
207 __FUNCTION__);
208 return -EINVAL;
209 }
210
211 secondary_bus = bridge_dev->subordinate;
212
213 if (unmap_bus_range(secondary_bus)) {
214 printk(KERN_ERR "%s: failed to unmap bus range\n",
215 __FUNCTION__);
216 return -ERANGE;
217 }
218
219 pci_remove_bus_device(bridge_dev);
220 return 0;
221}
222
223static inline int dlpar_add_pci_slot(char *drc_name, struct device_node *dn) 201static inline int dlpar_add_pci_slot(char *drc_name, struct device_node *dn)
224{ 202{
225 struct pci_dev *dev; 203 struct pci_dev *dev;
@@ -415,14 +393,7 @@ static int dlpar_remove_vio_slot(struct device_node *dn, char *drc_name)
415 */ 393 */
416int dlpar_remove_pci_slot(struct slot *slot, char *drc_name) 394int dlpar_remove_pci_slot(struct slot *slot, char *drc_name)
417{ 395{
418 struct pci_dev *bridge_dev; 396 struct pci_bus *bus = slot->bus;
419
420 bridge_dev = slot->bridge;
421 if (!bridge_dev) {
422 printk(KERN_ERR "%s: unexpected null bridge device\n",
423 __FUNCTION__);
424 return -EIO;
425 }
426 397
427 /* Remove hotplug slot */ 398 /* Remove hotplug slot */
428 if (rpaphp_remove_slot(slot)) { 399 if (rpaphp_remove_slot(slot)) {
@@ -431,13 +402,14 @@ int dlpar_remove_pci_slot(struct slot *slot, char *drc_name)
431 return -EIO; 402 return -EIO;
432 } 403 }
433 404
434 /* Remove pci bus */ 405 if (unmap_bus_range(bus)) {
435 406 printk(KERN_ERR "%s: failed to unmap bus range\n",
436 if (dlpar_pci_remove_bus(bridge_dev)) { 407 __FUNCTION__);
437 printk(KERN_ERR "%s: unable to remove pci bus %s\n", 408 return -ERANGE;
438 __FUNCTION__, drc_name);
439 return -EIO;
440 } 409 }
410
411 BUG_ON(!bus->self);
412 pci_remove_bus_device(bus->self);
441 return 0; 413 return 0;
442} 414}
443 415