diff options
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv_acpi.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/pci/pcie/aer/aerdrv_acpi.c b/drivers/pci/pcie/aer/aerdrv_acpi.c index f685bf5cdab9..8c199ae84f6d 100644 --- a/drivers/pci/pcie/aer/aerdrv_acpi.c +++ b/drivers/pci/pcie/aer/aerdrv_acpi.c | |||
@@ -31,23 +31,13 @@ int aer_osc_setup(struct pcie_device *pciedev) | |||
31 | { | 31 | { |
32 | acpi_status status = AE_NOT_FOUND; | 32 | acpi_status status = AE_NOT_FOUND; |
33 | struct pci_dev *pdev = pciedev->port; | 33 | struct pci_dev *pdev = pciedev->port; |
34 | acpi_handle handle = DEVICE_ACPI_HANDLE(&pdev->dev); | 34 | acpi_handle handle = 0; |
35 | struct pci_bus *parent; | ||
36 | 35 | ||
37 | while (!handle) { | 36 | /* Find root host bridge */ |
38 | if (!pdev || !pdev->bus->parent) | 37 | while (pdev->bus && pdev->bus->self) |
39 | break; | 38 | pdev = pdev->bus->self; |
40 | parent = pdev->bus->parent; | 39 | handle = acpi_get_pci_rootbridge_handle( |
41 | if (!parent->self) | 40 | pci_domain_nr(pdev->bus), pdev->bus->number); |
42 | /* Parent must be a host bridge */ | ||
43 | handle = acpi_get_pci_rootbridge_handle( | ||
44 | pci_domain_nr(parent), | ||
45 | parent->number); | ||
46 | else | ||
47 | handle = DEVICE_ACPI_HANDLE( | ||
48 | &(parent->self->dev)); | ||
49 | pdev = parent->self; | ||
50 | } | ||
51 | 41 | ||
52 | if (handle) { | 42 | if (handle) { |
53 | pcie_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT); | 43 | pcie_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT); |