]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
PCI: rpaphp: Use pcibios_remove_pci_devices() symmetrically
authorLinas Vepstas <linas@austin.ibm.com>
Fri, 13 Apr 2007 22:34:23 +0000 (15:34 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 3 May 2007 02:02:40 +0000 (19:02 -0700)
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@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/hotplug/rpaphp_core.c

index aa8d9a60d0a6355ce81fd864be53cd99dbdf3670..4efdaa19e8f92d3f8f640d4dfae888333e204fc0 100644 (file)
@@ -424,18 +424,12 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)
        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;
 }