ACPI / scan: Add acpi_device objects for all device nodes in the namespace
[firefly-linux-kernel-4.4.55.git] / drivers / acpi / pci_root.c
index 0703bff5e60ecaf2f9d207f9ffc1691d50380384..4076491c6ded1840000e4521ef7e129e0d547092 100644 (file)
@@ -65,6 +65,9 @@ static struct acpi_scan_handler pci_root_handler = {
        .ids = root_device_ids,
        .attach = acpi_pci_root_add,
        .detach = acpi_pci_root_remove,
+       .hotplug = {
+               .ignore = true,
+       },
 };
 
 static DEFINE_MUTEX(osc_lock);
@@ -631,9 +634,10 @@ void __init acpi_pci_root_init(void)
 
 static void handle_root_bridge_insertion(acpi_handle handle)
 {
-       struct acpi_device *device;
+       struct acpi_device *device = NULL;
 
-       if (!acpi_bus_get_device(handle, &device)) {
+       acpi_bus_get_device(handle, &device);
+       if (acpi_device_enumerated(device)) {
                dev_printk(KERN_DEBUG, &device->dev,
                           "acpi device already exists; ignoring notify\n");
                return;