summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2012-09-24 14:51:23 -0600
committerBjorn Helgaas <bhelgaas@google.com>2012-09-24 14:51:23 -0600
commit059e4ba292c69cb400cda92fbd37f25d4eec564b (patch)
treec9c3682700550fadeba47b2253c48592f8c5c97d /include
parentc29aabe22eafb4914aecebab6e99623894d81564 (diff)
downloadkernel-common-059e4ba292c69cb400cda92fbd37f25d4eec564b.tar.gz
kernel-common-059e4ba292c69cb400cda92fbd37f25d4eec564b.tar.bz2
kernel-common-059e4ba292c69cb400cda92fbd37f25d4eec564b.zip
PCI/ACPI: Use DEVICE_ACPI_HANDLE rather than searching acpi_pci_roots
When we bind a device to an ACPI handle, the handle is stored in dev->archdata.acpi_handle. For such devices, there's no need to search the acpi_pci_roots list with acpi_get_pci_rootbridge_handle(); we can just use DEVICE_ACPI_HANDLE(dev) directly. [bhelgaas: changelog, reorder "if" to avoid negation] Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Len Brown <lenb@kernel.org> Cc: linux-acpi@vger.kernel.org
Diffstat (limited to 'include')
-rw-r--r--include/linux/pci-acpi.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 248fba2af98a..9a22b5efb384 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -22,19 +22,24 @@ extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle);
static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
{
struct pci_bus *pbus = pdev->bus;
+
/* Find a PCI root bus */
while (!pci_is_root_bus(pbus))
pbus = pbus->parent;
- return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus),
- pbus->number);
+
+ return DEVICE_ACPI_HANDLE(pbus->bridge);
}
static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
{
- if (!pci_is_root_bus(pbus))
- return DEVICE_ACPI_HANDLE(&(pbus->self->dev));
- return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus),
- pbus->number);
+ struct device *dev;
+
+ if (pci_is_root_bus(pbus))
+ dev = pbus->bridge;
+ else
+ dev = &pbus->self->dev;
+
+ return DEVICE_ACPI_HANDLE(dev);
}
#endif