Skip to content

Commit

Permalink
PCI/ACPI: Notify acpi_pci_drivers when hot-plugging PCI root bridges
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiang Liu authored and bjorn-helgaas committed Sep 24, 2012
1 parent 8ee5bdf commit c8e9afb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/acpi/pci_root.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,14 +626,25 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
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);
Expand Down

0 comments on commit c8e9afb

Please sign in to comment.