@@ -210,8 +210,8 @@ static int acpi_platform_notify(struct device *dev)
acpi_handle handle;
int ret = -EINVAL;
- if (!dev->bus || !dev->parent) {
- /* bridge devices genernally haven't bus or parent */
+ if (!dev->bus) {
+ /* bridge devices genernally haven't bus */
ret = acpi_find_bridge_device(dev, &handle);
goto end;
}
@@ -360,7 +360,8 @@ static int acpi_pci_find_device(struct device *dev, acpi_handle *handle)
return 0;
}
-static int acpi_pci_find_root_bridge(struct device *dev, acpi_handle *handle)
+static int acpi_pci_host_bridge_find_device(struct device *dev,
+ acpi_handle *handle)
{
int num;
unsigned int seg, bus;
@@ -378,10 +379,14 @@ static int acpi_pci_find_root_bridge(struct device *dev, acpi_handle *handle)
return 0;
}
+static struct acpi_bus_type acpi_pci_host_bridge_bus = {
+ .bus = &pci_host_bridge_bus_type,
+ .find_device = acpi_pci_host_bridge_find_device,
+};
+
static struct acpi_bus_type acpi_pci_bus = {
.bus = &pci_bus_type,
.find_device = acpi_pci_find_device,
- .find_bridge = acpi_pci_find_root_bridge,
};
static int __init acpi_pci_init(void)
@@ -398,6 +403,10 @@ static int __init acpi_pci_init(void)
pcie_no_aspm();
}
+ ret = register_acpi_bus_type(&acpi_pci_host_bridge_bus);
+ if (ret)
+ return 0;
+
ret = register_acpi_bus_type(&acpi_pci_bus);
if (ret)
return 0;
Instead of abusing of acp_bus_type for pci device and checking device name tricks Signed-off-by: Yinghai Lu <yinghai@kernel.org> Cc: Len Brown <lenb@kernel.org> Cc: linux-acpi@vger.kernel.org --- drivers/acpi/glue.c | 4 ++-- drivers/pci/pci-acpi.c | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-)