From a43380e3d5637b5d2e23b001a5c2519696a21c5d Mon Sep 17 00:00:00 2001 From: Bill XIE Date: Wed, 3 Aug 2022 00:18:14 +0800 Subject: [PATCH] pciexp_device: Fix a bug in pciexp_enable_ltr() 'parent_cap' should be found from 'parent' instead of 'dev'. Signed-off-by: Bill XIE Change-Id: I99dab83d90287ca924d30dc4aeac0ff96e877e5c Reviewed-on: https://review.coreboot.org/c/coreboot/+/66385 Tested-by: build bot (Jenkins) Reviewed-by: Elyes Haouas Reviewed-by: Lean Sheng Tan Reviewed-by: Arthur Heymans Reviewed-by: Nico Huber Reviewed-by: Martin L Roth --- src/device/pciexp_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device/pciexp_device.c b/src/device/pciexp_device.c index 36143402ab..c03c224003 100644 --- a/src/device/pciexp_device.c +++ b/src/device/pciexp_device.c @@ -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; }