]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/pci/pci-acpi.c
Merge tag 'pci-v3.10-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
[karo-tx-linux.git] / drivers / pci / pci-acpi.c
index 5147c210df52999c5ebe9d00e08b357c24dfd4c6..e4b1fb2c0f5d83029e0a62ffa4aaef36f4559da3 100644 (file)
@@ -288,6 +288,32 @@ static struct pci_platform_pm_ops acpi_pci_platform_pm = {
        .run_wake = acpi_pci_run_wake,
 };
 
+void acpi_pci_add_bus(struct pci_bus *bus)
+{
+       acpi_handle handle = NULL;
+
+       if (bus->bridge)
+               handle = ACPI_HANDLE(bus->bridge);
+       if (acpi_pci_disabled || handle == NULL)
+               return;
+
+       acpi_pci_slot_enumerate(bus, handle);
+       acpiphp_enumerate_slots(bus, handle);
+}
+
+void acpi_pci_remove_bus(struct pci_bus *bus)
+{
+       /*
+        * bus->bridge->acpi_node.handle has already been reset to NULL
+        * when acpi_pci_remove_bus() is called, so don't check ACPI handle.
+        */
+       if (acpi_pci_disabled)
+               return;
+
+       acpiphp_remove_slots(bus);
+       acpi_pci_slot_remove(bus);
+}
+
 /* ACPI bus type */
 static int acpi_pci_find_device(struct device *dev, acpi_handle *handle)
 {
@@ -362,7 +388,11 @@ static int __init acpi_pci_init(void)
        ret = register_acpi_bus_type(&acpi_pci_bus);
        if (ret)
                return 0;
+
        pci_set_platform_pm(&acpi_pci_platform_pm);
+       acpi_pci_slot_init();
+       acpiphp_init();
+
        return 0;
 }
 arch_initcall(acpi_pci_init);