summaryrefslogtreecommitdiff
path: root/include/linux/pci-acpi.h
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2008-08-18 20:22:54 +0200
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-08-18 13:48:04 -0700
commit056c58e8eb4d6765214757e541b68095e2eb2bd2 (patch)
treea6d7a8c5df552347aca6588b432b9f0ae3939a59 /include/linux/pci-acpi.h
parente0d94beead4ef652ec1c066be886140eebb06d8b (diff)
PCI: add acpi_find_root_bridge_handle
Consolidate finding of a root bridge and getting its handle to the one inline function. It's cut & pasted on multiple places. Use this new inline in those. Cc: kristen.c.accardi@intel.com Acked-by: Alex Chiang <achiang@hp.com> Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'include/linux/pci-acpi.h')
-rw-r--r--include/linux/pci-acpi.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 3ba25065fa96..8837928fbf33 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -57,6 +57,15 @@ static inline acpi_status pcie_osc_support_set(u32 flags)
{
return __pci_osc_support_set(flags, PCI_EXPRESS_ROOT_HID_STRING);
}
+static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
+{
+ /* Find root host bridge */
+ while (pdev->bus->self)
+ pdev = pdev->bus->self;
+
+ return acpi_get_pci_rootbridge_handle(pci_domain_nr(pdev->bus),
+ pdev->bus->number);
+}
#else
#if !defined(AE_ERROR)
typedef u32 acpi_status;
@@ -66,6 +75,8 @@ static inline acpi_status pci_osc_control_set(acpi_handle handle, u32 flags)
{return AE_ERROR;}
static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;}
static inline acpi_status pcie_osc_support_set(u32 flags) {return AE_ERROR;}
+static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
+{ return NULL; }
#endif
#endif /* _PCI_ACPI_H_ */