]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commitdiff
PCI/ACPI: Notify acpi_pci_drivers when hot-plugging PCI root bridges
authorJiang Liu <jiang.liu@huawei.com>
Tue, 18 Sep 2012 06:20:34 +0000 (15:20 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 24 Sep 2012 21:29:40 +0000 (15:29 -0600)
When hot-plugging PCI root bridge, acpi_pci_drivers' add()/remove()
methods should be invoked to notify registered drivers.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/acpi/pci_root.c

index 68d679e212485f76526f9843e2cea96c3cb11d56..4bec13d9c2bfc68529ca0fa2fe978a63ab9b315c 100644 (file)
@@ -626,14 +626,25 @@ end:
 static int acpi_pci_root_start(struct acpi_device *device)
 {
        struct acpi_pci_root *root = acpi_driver_data(device);
+       struct acpi_pci_driver *driver;
+
+       list_for_each_entry(driver, &acpi_pci_drivers, node)
+               if (driver->add)
+                       driver->add(device->handle);
 
        pci_bus_add_devices(root->bus);
+
        return 0;
 }
 
 static int acpi_pci_root_remove(struct acpi_device *device, int type)
 {
        struct acpi_pci_root *root = acpi_driver_data(device);
+       struct acpi_pci_driver *driver;
+
+       list_for_each_entry(driver, &acpi_pci_drivers, node)
+               if (driver->remove)
+                       driver->remove(root->device->handle);
 
        device_set_run_wake(root->bus->bridge, false);
        pci_acpi_remove_bus_pm_notifier(device);