From 7879b446b03c7d66c86ac8ef9c06848ddc356c18 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Mon, 18 Aug 2008 20:22:54 +0200 Subject: [PATCH] --- yaml --- r: 108863 b: refs/heads/master c: 056c58e8eb4d6765214757e541b68095e2eb2bd2 h: refs/heads/master i: 108861: a962381b5c424b0676c3843f1230344aa5a2cee6 108859: b564fc29984c6317fe3bbfab4965e535ad0d6172 108855: b612633f99d4f03e479c33a7569072ddf27d26d9 108847: 9303e010522c7feaff6d6b4ce06b39f89c8b3318 108831: fcc2fef67b978ebe965b4d4b21a345630f883e3b 108799: b3dd26fe354d7a61876f38cd6b7b4ba9a0a38a0c v: v3 --- [refs] | 2 +- trunk/drivers/pci/hotplug/acpi_pcihp.c | 5 +---- trunk/drivers/pci/pcie/aer/aerdrv_acpi.c | 7 +------ trunk/include/linux/pci-acpi.h | 11 +++++++++++ 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 620e4ed6d3a2..a24b6969544f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e0d94beead4ef652ec1c066be886140eebb06d8b +refs/heads/master: 056c58e8eb4d6765214757e541b68095e2eb2bd2 diff --git a/trunk/drivers/pci/hotplug/acpi_pcihp.c b/trunk/drivers/pci/hotplug/acpi_pcihp.c index bd831970f00b..e17ef54f0efc 100644 --- a/trunk/drivers/pci/hotplug/acpi_pcihp.c +++ b/trunk/drivers/pci/hotplug/acpi_pcihp.c @@ -404,10 +404,7 @@ int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags) * OSHP within the scope of the hotplug controller and its parents, * upto the host bridge under which this controller exists. */ - while (pdev->bus->self) - pdev = pdev->bus->self; - handle = acpi_get_pci_rootbridge_handle(pci_domain_nr(pdev->bus), - pdev->bus->number); + handle = acpi_find_root_bridge_handle(pdev); if (handle) { acpi_get_name(handle, ACPI_FULL_PATHNAME, &string); dbg("Trying to get hotplug control for %s\n", diff --git a/trunk/drivers/pci/pcie/aer/aerdrv_acpi.c b/trunk/drivers/pci/pcie/aer/aerdrv_acpi.c index 30f581b8791f..6dd7b13e9808 100644 --- a/trunk/drivers/pci/pcie/aer/aerdrv_acpi.c +++ b/trunk/drivers/pci/pcie/aer/aerdrv_acpi.c @@ -36,12 +36,7 @@ int aer_osc_setup(struct pcie_device *pciedev) if (acpi_pci_disabled) return -1; - /* Find root host bridge */ - while (pdev->bus->self) - pdev = pdev->bus->self; - handle = acpi_get_pci_rootbridge_handle( - pci_domain_nr(pdev->bus), pdev->bus->number); - + handle = acpi_find_root_bridge_handle(pdev); if (handle) { pcie_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT); status = pci_osc_control_set(handle, diff --git a/trunk/include/linux/pci-acpi.h b/trunk/include/linux/pci-acpi.h index 3ba25065fa96..8837928fbf33 100644 --- a/trunk/include/linux/pci-acpi.h +++ b/trunk/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_ */