PCI/ACPI: Handle PCI slot devices when creating/destroying PCI buses
Currently the pci_slot driver doesn't update PCI slot devices when PCI
device hotplug event happens, which may cause memory leak and returning
stale information to user.
Now the pci_slot driver has been changed as built-in driver, so invoke
PCI slot enumeration and destroy routines directly from the PCI core.
And remove ACPI PCI sub-driver related code because it isn't needed
any more.
[bhelgas: removed "extern" from function declarations]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Toshi Kani <toshi.kani@hp.com>
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index b8b8437..98e582a 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -296,7 +296,7 @@
if (acpi_pci_disabled || handle == NULL)
return;
- /* TODO: add PCI slots and acpiphp hotplug slots */
+ acpi_pci_slot_enumerate(bus, handle);
}
void acpi_pci_remove_bus(struct pci_bus *bus)
@@ -308,7 +308,7 @@
if (acpi_pci_disabled)
return;
- /* TODO: remove PCI slots and acpiphp hotplug slots */
+ acpi_pci_slot_remove(bus);
}
/* ACPI bus type */
@@ -385,7 +385,10 @@
ret = register_acpi_bus_type(&acpi_pci_bus);
if (ret)
return 0;
+
pci_set_platform_pm(&acpi_pci_platform_pm);
+ acpi_pci_slot_init();
+
return 0;
}
arch_initcall(acpi_pci_init);