aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci-acpi.c')
-rw-r--r--drivers/pci/pci-acpi.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index 2bdbc0080204..f49abef88485 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -12,9 +12,6 @@
12#include <linux/pci.h> 12#include <linux/pci.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/pci-aspm.h> 14#include <linux/pci-aspm.h>
15#include <acpi/acpi.h>
16#include <acpi/acpi_bus.h>
17
18#include <linux/pci-acpi.h> 15#include <linux/pci-acpi.h>
19#include <linux/pm_runtime.h> 16#include <linux/pm_runtime.h>
20#include <linux/pm_qos.h> 17#include <linux/pm_qos.h>
@@ -306,10 +303,10 @@ void acpi_pci_remove_bus(struct pci_bus *bus)
306} 303}
307 304
308/* ACPI bus type */ 305/* ACPI bus type */
309static int acpi_pci_find_device(struct device *dev, acpi_handle *handle) 306static struct acpi_device *acpi_pci_find_companion(struct device *dev)
310{ 307{
311 struct pci_dev *pci_dev = to_pci_dev(dev); 308 struct pci_dev *pci_dev = to_pci_dev(dev);
312 bool is_bridge; 309 bool check_children;
313 u64 addr; 310 u64 addr;
314 311
315 /* 312 /*
@@ -317,14 +314,12 @@ static int acpi_pci_find_device(struct device *dev, acpi_handle *handle)
317 * is set only after acpi_pci_find_device() has been called for the 314 * is set only after acpi_pci_find_device() has been called for the
318 * given device. 315 * given device.
319 */ 316 */
320 is_bridge = pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE 317 check_children = pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE
321 || pci_dev->hdr_type == PCI_HEADER_TYPE_CARDBUS; 318 || pci_dev->hdr_type == PCI_HEADER_TYPE_CARDBUS;
322 /* Please ref to ACPI spec for the syntax of _ADR */ 319 /* Please ref to ACPI spec for the syntax of _ADR */
323 addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn); 320 addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn);
324 *handle = acpi_find_child(ACPI_HANDLE(dev->parent), addr, is_bridge); 321 return acpi_find_child_device(ACPI_COMPANION(dev->parent), addr,
325 if (!*handle) 322 check_children);
326 return -ENODEV;
327 return 0;
328} 323}
329 324
330static void pci_acpi_setup(struct device *dev) 325static void pci_acpi_setup(struct device *dev)
@@ -367,7 +362,7 @@ static bool pci_acpi_bus_match(struct device *dev)
367static struct acpi_bus_type acpi_pci_bus = { 362static struct acpi_bus_type acpi_pci_bus = {
368 .name = "PCI", 363 .name = "PCI",
369 .match = pci_acpi_bus_match, 364 .match = pci_acpi_bus_match,
370 .find_device = acpi_pci_find_device, 365 .find_companion = acpi_pci_find_companion,
371 .setup = pci_acpi_setup, 366 .setup = pci_acpi_setup,
372 .cleanup = pci_acpi_cleanup, 367 .cleanup = pci_acpi_cleanup,
373}; 368};