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>
diff --git a/src/device/pciexp_device.c b/src/device/pciexp_device.c
index 3614340..c03c224 100644
--- a/src/device/pciexp_device.c
+++ b/src/device/pciexp_device.c
@@ -183,7 +183,7 @@
 	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;
 	}