pciexp_device: Fix a bug in pciexp_enable_ltr()

'parent_cap' should be found from 'parent' instead of 'dev'.

Signed-off-by: Bill XIE <persmule@hardenedlinux.org>
Change-Id: I99dab83d90287ca924d30dc4aeac0ff96e877e5c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66385
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
This commit is contained in:
Bill XIE 2022-08-03 00:18:14 +08:00 committed by Martin L Roth
parent debb8085c6
commit a43380e3d5
1 changed files with 1 additions and 1 deletions

View File

@ -183,7 +183,7 @@ static void pciexp_enable_ltr(struct device *dev)
unsigned int parent_cap = 0;
if (!dev->ops->ops_pci || !dev->ops->ops_pci->get_ltr_max_latencies) {
parent = dev->bus->dev;
parent_cap = pci_find_capability(dev, PCI_CAP_ID_PCIE);
parent_cap = pci_find_capability(parent, PCI_CAP_ID_PCIE);
if (!parent_cap)
return;
}