From kristen.c.accardi@intel.com Fri Apr 13 15:34:20 2007 From: Linas Vepstas Date: Fri, 13 Apr 2007 15:34:23 -0700 Subject: [patch 17/21] PCI: rpaphp: Use pcibios_remove_pci_devices() symmetrically To: gregkh@suse.de Message-ID: <20070413223420.790058506@intel.com> Content-Disposition: inline; filename=pci-rpaphp-use-pcibios_remove_pci_devices-symmetrically From: Linas Vepstas 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 Cc: John Rose Signed-off-by: Kristen Carlson Accardi Signed-off-by: Greg Kroah-Hartman --- drivers/pci/hotplug/rpaphp_core.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) --- a/drivers/pci/hotplug/rpaphp_core.c +++ b/drivers/pci/hotplug/rpaphp_core.c @@ -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; }