From 24e14f9437a597f633b70caf4040cf1712901419 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Sun, 20 Jun 2021 14:03:35 +0200 Subject: [PATCH] nb/intel/haswell/pcie.c: Fix getting PCI function Use `dev->path.pci.devfn` to obtain the `devfn` that `PCI_FUNC` needs. Tested on Asrock B85M Pro4, `PCI_FUNC` now obtains the correct value. Change-Id: Ia3bbd56ce0adba9d24f62ffc016cd825bcf3cc6a Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/55688 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/northbridge/intel/haswell/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/northbridge/intel/haswell/pcie.c b/src/northbridge/intel/haswell/pcie.c index ac6d4ca7c0..d93639932f 100644 --- a/src/northbridge/intel/haswell/pcie.c +++ b/src/northbridge/intel/haswell/pcie.c @@ -50,7 +50,7 @@ static void peg_enable(struct device *dev) { const struct northbridge_intel_haswell_config *config = config_of(dev); - const uint8_t func = PCI_FUNC(PCI_BDF(dev)); + const uint8_t func = PCI_FUNC(dev->path.pci.devfn); assert(func < ARRAY_SIZE(config->peg_cfg));