summaryrefslogtreecommitdiff
path: root/src/device/pci_device.c
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2022-08-05 12:58:18 +0200
committerFelix Held <felix-coreboot@felixheld.de>2022-08-17 16:29:39 +0000
commit5ffc2c8a3f38fbb7be2faadf207590acd3999205 (patch)
treec46ac16e011b35867b67550a66a57ee0a7333b8c /src/device/pci_device.c
parentd5ab24cd48006022ca60fe35f0f0366f3edce748 (diff)
pciexp_device: Join pciexp_find_(next_)extended_cap() APIs
Move the `offset` parameter into pciexp_find_extended_cap(). If it's called with `0`, we start a new search. If it's an existing offset, we continue the search. This makes it easier to search for multiple occurences of a capa- bility in a single loop. Change-Id: I80115372a82523b90460d97f0fd0fa565c3f56cb Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66453 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/device/pci_device.c')
-rw-r--r--src/device/pci_device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/device/pci_device.c b/src/device/pci_device.c
index 44c47a7548..232328dca8 100644
--- a/src/device/pci_device.c
+++ b/src/device/pci_device.c
@@ -313,7 +313,7 @@ struct msix_entry *pci_msix_get_table(struct device *dev)
static unsigned int get_rebar_offset(const struct device *dev, unsigned long index)
{
- uint32_t offset = pciexp_find_extended_cap(dev, PCIE_EXT_CAP_RESIZABLE_BAR);
+ uint32_t offset = pciexp_find_extended_cap(dev, PCIE_EXT_CAP_RESIZABLE_BAR, 0);
if (!offset)
return 0;