mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-29 16:03:47 +02:00
pcidev: Always fetch ident info
As discovered earlier[1], the `vendor_id` and `device_id` fields are not always automatically set. However, we use these fields throughout flash- rom. To not lose track when we actually fetched them, let's always call pci_fill_info(PCI_FILL_IDENT) before returning a `pci_dev` handle. [1] Commit ca2e3bce0 (pcidev.c: populate IDs with pci_fill_info()) Signed-off-by: Nico Huber <nico.h@gmx.de> Change-Id: Iae2511178bec44343cbe902722fdca9eda036059 Ticket: https://ticket.coreboot.org/issues/367 Reviewed-on: https://review.coreboot.org/c/flashrom/+/64573 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
This commit is contained in:
parent
b4dd9f9039
commit
5af0ff3840
14
pcidev.c
14
pcidev.c
@ -151,9 +151,12 @@ uintptr_t pcidev_readbar(struct pci_dev *dev, int bar)
|
||||
struct pci_dev *pcidev_scandev(struct pci_filter *filter, struct pci_dev *start)
|
||||
{
|
||||
struct pci_dev *temp;
|
||||
for (temp = start ? start->next : pacc->devices; temp; temp = temp->next)
|
||||
if (pci_filter_match(filter, temp))
|
||||
for (temp = start ? start->next : pacc->devices; temp; temp = temp->next) {
|
||||
if (pci_filter_match(filter, temp)) {
|
||||
pci_fill_info(temp, PCI_FILL_IDENT);
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -190,14 +193,17 @@ struct pci_dev *pcidev_find(uint16_t vendor, uint16_t device)
|
||||
struct pci_dev *pcidev_getdevfn(struct pci_dev *dev, const int func)
|
||||
{
|
||||
#if !defined(OLD_PCI_GET_DEV)
|
||||
return pci_get_dev(pacc, dev->domain, dev->bus, dev->dev, func);
|
||||
struct pci_dev *const new = pci_get_dev(pacc, dev->domain, dev->bus, dev->dev, func);
|
||||
#else
|
||||
/* pciutils/libpci before version 2.2 is too old to support
|
||||
* PCI domains. Such old machines usually don't have domains
|
||||
* besides domain 0, so this is not a problem.
|
||||
*/
|
||||
return pci_get_dev(pacc, dev->bus, dev->dev, func);
|
||||
struct pci_dev *const new = pci_get_dev(pacc, dev->bus, dev->dev, func);
|
||||
#endif
|
||||
if (new)
|
||||
pci_fill_info(new, PCI_FILL_IDENT);
|
||||
return new;
|
||||
}
|
||||
|
||||
struct pci_dev *pcidev_find_vendorclass(uint16_t vendor, uint16_t devclass)
|
||||
|
Loading…
x
Reference in New Issue
Block a user