1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-08-16 20:04:41 +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())

Backported to older versions where pcidev handling was much more
scattered.

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
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67859
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
This commit is contained in:
Nico Huber
2022-05-23 01:45:11 +02:00
committed by Felix Singer
parent bb83de61d1
commit d6a50cb8c7
2 changed files with 17 additions and 6 deletions

View File

@@ -1510,6 +1510,7 @@ static int intel_ich_gpio_set(int gpio, int raise)
/* First, look for a known LPC bridge */
for (dev = pacc->devices; dev; dev = dev->next) {
pci_fill_info(dev, PCI_FILL_IDENT);
uint16_t device_class;
/* libpci before version 2.2.4 does not store class info. */
device_class = pci_read_word(dev, PCI_CLASS_DEVICE);