summaryrefslogtreecommitdiff
path: root/drivers/acpi/pci_root.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-12-21 03:36:40 +0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-03 16:09:37 +0400
commit92ef2a25c763338905dce8344a0584606f842920 (patch)
tree401423e2465e3638a36a64894187d00689dde50c /drivers/acpi/pci_root.c
parent805d410fb0dbd65e1a57a810858fa2491e75822d (diff)
downloadlinux-92ef2a25c763338905dce8344a0584606f842920.tar.xz
ACPI: Change the ordering of PCI root bridge driver registrarion
Instead of running acpi_pci_root_init() from a separate subsys initcall, call it directly from acpi_scan_init() before scanning the ACPI namespace for the first time, so that the PCI root bridge driver's .add() routine, acpi_pci_root_start(), is always run before binding ACPI drivers or attaching "companion" device objects to struct acpi_device objects below the root bridge's device node in the ACPI namespace. The first, simpler reason for doing this is that it makes the situation during boot more similar to the situation during hotplug, in which the ACPI PCI root bridge driver is always present. The second reason is that acpi_pci_root_init() causes struct pci_dev objects to be created for all PCI devices below the bridge and these objects may be necessary for whatever is done with the other ACPI device nodes in that namespace scope. For example, devices created by acpi_create_platform_device() sometimes may need to be added to the device hierarchy as children of PCI bridges. For this purpose, however, the struct pci_dev objects representing those bridges need to exist before the platform devices in question are registered. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Yinghai Lu <yinghai@kernel.org> Acked-by: Toshi Kani <toshi.kani@hp.com>
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r--drivers/acpi/pci_root.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 7928d4dc7056..a233fe93dfac 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -699,7 +699,7 @@ static int acpi_pci_root_remove(struct acpi_device *device, int type)
return 0;
}
-static int __init acpi_pci_root_init(void)
+int __init acpi_pci_root_init(void)
{
acpi_hest_init();
@@ -712,5 +712,3 @@ static int __init acpi_pci_root_init(void)
return 0;
}
-
-subsys_initcall(acpi_pci_root_init);