diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2010-05-21 23:00:56 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2010-05-21 23:00:56 +0000 |
commit | d175e06ac305274d8e1a8a4658f7f5518c89b801 (patch) | |
tree | 25f0a15356ac23f3458d77f2e636fc4ca57ae112 | |
parent | 52a15492bdb22ce792611a078ea247968dbd7e65 (diff) | |
download | flashrom-d175e06ac305274d8e1a8a4658f7f5518c89b801.tar.gz flashrom-d175e06ac305274d8e1a8a4658f7f5518c89b801.tar.bz2 flashrom-d175e06ac305274d8e1a8a4658f7f5518c89b801.zip |
Libpci < 2.2.4 can not store class info in struct pci_dev
Read class info manually and store it in a separate variable.
Corresponding to flashrom svn r1004.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
-rw-r--r-- | board_enable.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/board_enable.c b/board_enable.c index 2cf81c24b..3fffaa5c3 100644 --- a/board_enable.c +++ b/board_enable.c @@ -789,9 +789,11 @@ 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_CLASS); + uint16_t device_class; + /* libpci before version 2.2.4 does not store class info. */ + device_class = pci_read_word(dev, PCI_CLASS_DEVICE); if ((dev->vendor_id == 0x8086) && - (dev->device_class == 0x0601)) { /* ISA Bridge */ + (device_class == 0x0601)) { /* ISA Bridge */ /* Is this device in our list? */ for (i = 0; intel_ich_gpio_table[i].id; i++) if (dev->device_id == intel_ich_gpio_table[i].id) |