PCI/ACPI: Remove acpi_root_driver in reverse order
authorYinghai Lu <yinghai@kernel.org>
Tue, 30 Oct 2012 20:31:52 +0000 (14:31 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Sat, 3 Nov 2012 22:26:37 +0000 (16:26 -0600)
Call the sub-driver .remove() methods in the reverse order of the
.add() methods for symmetry.

[bhelgaas: changelog]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/pci_root.c

index a27cbb572fe1c3ab4e0bd0c24668668204dcee8e..012f40d1d75d389a1bb05598fa77f5c960e2d7c8 100644 (file)
@@ -672,7 +672,7 @@ static int acpi_pci_root_remove(struct acpi_device *device, int type)
        pci_stop_root_bus(root->bus);
 
        mutex_lock(&acpi_pci_root_lock);
-       list_for_each_entry(driver, &acpi_pci_drivers, node)
+       list_for_each_entry_reverse(driver, &acpi_pci_drivers, node)
                if (driver->remove)
                        driver->remove(root);
        mutex_unlock(&acpi_pci_root_lock);