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 56f05869b08df2ab89bafd661d97b282c36d0b8b..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);
@@ -575,6 +578,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
                dev_err(&device->dev,
                        "Bus %04x:%02x not present in PCI namespace\n",
                        root->segment, (unsigned int)root->secondary.start);
+               device->driver_data = NULL;
                result = -ENODEV;
                goto end;
        }
@@ -630,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;