[PATCH 17/19] PCI: rpaphp: Use pcibios_remove_pci_devices() symmetrically

Linas Vepstas linas at austin.ibm.com
Wed Apr 4 03:31:54 EST 2007


At first blush, the disable_slot() routine does not look
at all like its symmetric with the enable_slot() routine;
as it seems to call a very different set of routines.
However, this is easily fixed: pcibios_remove_pci_devices()
does the right thing.

Signed-off-by: Linas Vepstas <linas at austin.ibm.com>
Cc: John Rose <johnrose at austin.ibm.com>

----

 drivers/pci/hotplug/rpaphp_core.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Index: linux-2.6.21-rc4-git4/drivers/pci/hotplug/rpaphp_core.c
===================================================================
--- linux-2.6.21-rc4-git4.orig/drivers/pci/hotplug/rpaphp_core.c	2007-04-03 11:04:41.000000000 -0500
+++ linux-2.6.21-rc4-git4/drivers/pci/hotplug/rpaphp_core.c	2007-04-03 11:04:47.000000000 -0500
@@ -424,18 +424,12 @@ static int enable_slot(struct hotplug_sl
 	return retval;
 }
 
-static int __disable_slot(struct slot *slot)
+static inline int __disable_slot(struct slot *slot)
 {
-	struct pci_dev *dev, *tmp;
-
 	if (slot->state == NOT_CONFIGURED)
 		return -EINVAL;
 
-	list_for_each_entry_safe(dev, tmp, &slot->bus->devices, bus_list) {
-		eeh_remove_bus_device(dev);
-		pci_remove_bus_device(dev);
-	}
-
+	pcibios_remove_pci_devices(slot->bus);
 	slot->state = NOT_CONFIGURED;
 	return 0;
 }



More information about the Linuxppc-dev mailing list