ACPI / PCI: Make bus registration and unregistration symmetric
[linux-2.6-microblaze.git] / drivers / acpi / pci_slot.c
index 033d117..d678a18 100644 (file)
@@ -159,12 +159,16 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
        return AE_OK;
 }
 
-void acpi_pci_slot_enumerate(struct pci_bus *bus, acpi_handle handle)
+void acpi_pci_slot_enumerate(struct pci_bus *bus)
 {
-       mutex_lock(&slot_list_lock);
-       acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1,
-                           register_slot, NULL, bus, NULL);
-       mutex_unlock(&slot_list_lock);
+       acpi_handle handle = ACPI_HANDLE(bus->bridge);
+
+       if (handle) {
+               mutex_lock(&slot_list_lock);
+               acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1,
+                                   register_slot, NULL, bus, NULL);
+               mutex_unlock(&slot_list_lock);
+       }
 }
 
 void acpi_pci_slot_remove(struct pci_bus *bus)