diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2008-08-18 14:22:54 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-08-18 16:48:04 -0400 |
commit | 056c58e8eb4d6765214757e541b68095e2eb2bd2 (patch) | |
tree | a6d7a8c5df552347aca6588b432b9f0ae3939a59 /include | |
parent | e0d94beead4ef652ec1c066be886140eebb06d8b (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')
-rw-r--r-- | include/linux/pci-acpi.h | 11 |
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) | |||
57 | { | 57 | { |
58 | return __pci_osc_support_set(flags, PCI_EXPRESS_ROOT_HID_STRING); | 58 | return __pci_osc_support_set(flags, PCI_EXPRESS_ROOT_HID_STRING); |
59 | } | 59 | } |
60 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | ||
61 | { | ||
62 | /* Find root host bridge */ | ||
63 | while (pdev->bus->self) | ||
64 | pdev = pdev->bus->self; | ||
65 | |||
66 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pdev->bus), | ||
67 | pdev->bus->number); | ||
68 | } | ||
60 | #else | 69 | #else |
61 | #if !defined(AE_ERROR) | 70 | #if !defined(AE_ERROR) |
62 | typedef u32 acpi_status; | 71 | typedef u32 acpi_status; |
@@ -66,6 +75,8 @@ static inline acpi_status pci_osc_control_set(acpi_handle handle, u32 flags) | |||
66 | {return AE_ERROR;} | 75 | {return AE_ERROR;} |
67 | static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;} | 76 | static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;} |
68 | static inline acpi_status pcie_osc_support_set(u32 flags) {return AE_ERROR;} | 77 | static inline acpi_status pcie_osc_support_set(u32 flags) {return AE_ERROR;} |
78 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | ||
79 | { return NULL; } | ||
69 | #endif | 80 | #endif |
70 | 81 | ||
71 | #endif /* _PCI_ACPI_H_ */ | 82 | #endif /* _PCI_ACPI_H_ */ |