diff options
Diffstat (limited to 'drivers/pci/pcie/aspm.c')
-rw-r--r-- | drivers/pci/pcie/aspm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 973472c23d89..1dfa10cc566b 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c | |||
@@ -478,7 +478,7 @@ static void aspm_calc_l1ss_info(struct pcie_link_state *link, | |||
478 | 478 | ||
479 | static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist) | 479 | static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist) |
480 | { | 480 | { |
481 | struct pci_dev *child, *parent = link->pdev; | 481 | struct pci_dev *child = link->downstream, *parent = link->pdev; |
482 | struct pci_bus *linkbus = parent->subordinate; | 482 | struct pci_bus *linkbus = parent->subordinate; |
483 | struct aspm_register_info upreg, dwreg; | 483 | struct aspm_register_info upreg, dwreg; |
484 | 484 | ||
@@ -491,9 +491,7 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist) | |||
491 | 491 | ||
492 | /* Get upstream/downstream components' register state */ | 492 | /* Get upstream/downstream components' register state */ |
493 | pcie_get_aspm_reg(parent, &upreg); | 493 | pcie_get_aspm_reg(parent, &upreg); |
494 | child = pci_function_0(linkbus); | ||
495 | pcie_get_aspm_reg(child, &dwreg); | 494 | pcie_get_aspm_reg(child, &dwreg); |
496 | link->downstream = child; | ||
497 | 495 | ||
498 | /* | 496 | /* |
499 | * If ASPM not supported, don't mess with the clocks and link, | 497 | * If ASPM not supported, don't mess with the clocks and link, |
@@ -800,6 +798,7 @@ static struct pcie_link_state *alloc_pcie_link_state(struct pci_dev *pdev) | |||
800 | INIT_LIST_HEAD(&link->children); | 798 | INIT_LIST_HEAD(&link->children); |
801 | INIT_LIST_HEAD(&link->link); | 799 | INIT_LIST_HEAD(&link->link); |
802 | link->pdev = pdev; | 800 | link->pdev = pdev; |
801 | link->downstream = pci_function_0(pdev->subordinate); | ||
803 | 802 | ||
804 | /* | 803 | /* |
805 | * Root Ports and PCI/PCI-X to PCIe Bridges are roots of PCIe | 804 | * Root Ports and PCI/PCI-X to PCIe Bridges are roots of PCIe |