First attempt to clean up SPI probing and create a common
[coreboot.git] / util / flashrom / flashrom.c
index 2dc2de81a4840e1f56528315f43a493181fad2c5..63aba1e75bbb3e0dd57e1bfedf7bd9aa26258edb 100644 (file)
@@ -74,8 +74,8 @@ struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device,
 
        for (temp = pacc->devices; temp; temp = temp->next)
                if (pci_filter_match(&filter, temp)) {
-                       if ((card_vendor == pci_read_word(temp, 0x2C)) &&
-                           (card_device == pci_read_word(temp, 0x2E)))
+                       if ((card_vendor == pci_read_word(temp, PCI_SUBSYSTEM_VENDOR_ID)) &&
+                           (card_device == pci_read_word(temp, PCI_SUBSYSTEM_ID)))
                                return temp;
                }
 
@@ -378,7 +378,7 @@ int main(int argc, char *argv[])
 #else
        if (iopl(3) != 0) {
 #endif
-               fprintf(stderr, "ERROR: iopl failed: \"%s\"\n",
+               fprintf(stderr, "ERROR: Could not get IO privileges (%s).\nYou need to be root.\n",
                        strerror(errno));
                exit(1);
        }