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>
This commit is contained in:
Nico Huber
2022-08-05 12:58:18 +02:00
committed by Felix Held
parent d5ab24cd48
commit 5ffc2c8a3f
4 changed files with 27 additions and 16 deletions

View File

@@ -32,9 +32,8 @@ void pciexp_hotplug_scan_bridge(struct device *dev);
extern struct device_operations default_pciexp_hotplug_ops_bus;
unsigned int pciexp_find_extended_cap(const struct device *dev, unsigned int cap);
unsigned int pciexp_find_next_extended_cap(const struct device *dev, unsigned int cap,
unsigned int offset);
unsigned int pciexp_find_extended_cap(const struct device *dev, unsigned int cap,
unsigned int offset);
static inline bool pciexp_is_downstream_port(int type)
{