diff options
author | Mark Brown <broonie@linaro.org> | 2013-08-29 18:40:30 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-29 18:40:30 +0100 |
commit | 72bce45fdecab65936f1e466c5c5107e48f8251e (patch) | |
tree | e5009748ab6136465c812860b7913d06098ed520 /drivers/pci/pci-acpi.c | |
parent | 0d0c6fddf052ca1e5324297420ed587a95b7be82 (diff) | |
parent | 965abff8d8accdffc4af1b11fcf580e83031330a (diff) |
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-androidlsk-android-13.08
Diffstat (limited to 'drivers/pci/pci-acpi.c')
-rw-r--r-- | drivers/pci/pci-acpi.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index e4b1fb2c0f5d..336b3f94a19a 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -317,13 +317,20 @@ void acpi_pci_remove_bus(struct pci_bus *bus) /* ACPI bus type */ static int acpi_pci_find_device(struct device *dev, acpi_handle *handle) { - struct pci_dev * pci_dev; - u64 addr; + struct pci_dev *pci_dev = to_pci_dev(dev); + bool is_bridge; + u64 addr; - pci_dev = to_pci_dev(dev); + /* + * pci_is_bridge() is not suitable here, because pci_dev->subordinate + * is set only after acpi_pci_find_device() has been called for the + * given device. + */ + is_bridge = pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE + || pci_dev->hdr_type == PCI_HEADER_TYPE_CARDBUS; /* Please ref to ACPI spec for the syntax of _ADR */ addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn); - *handle = acpi_get_child(DEVICE_ACPI_HANDLE(dev->parent), addr); + *handle = acpi_find_child(ACPI_HANDLE(dev->parent), addr, is_bridge); if (!*handle) return -ENODEV; return 0; |