summaryrefslogtreecommitdiff
path: root/pcidev.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-03-07 01:08:09 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-03-07 01:08:09 +0000
commitecd28131d7ba98c29438f6d78756e894f3177b7b (patch)
tree381d046fea47f794966eae15695917e0f19c0eba /pcidev.c
parentd451cad61905ab88d63fb35e89384f0b30c4b2b9 (diff)
downloadflashrom-ecd28131d7ba98c29438f6d78756e894f3177b7b.tar.gz
Simplify pcidev_init by killing the vendorid parameter which was pretty
useless anyway since it was present in the pcidevs parameter as well. This also allows us to handle multiple programmers with different vendor IDs in the same driver. Fix compilation of flashrom with only the nicrealtek driver. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1274 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'pcidev.c')
-rw-r--r--pcidev.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/pcidev.c b/pcidev.c
index 5eddf79..e498014 100644
--- a/pcidev.c
+++ b/pcidev.c
@@ -188,8 +188,7 @@ uintptr_t pcidev_validate(struct pci_dev *dev, int bar,
return 0;
}
-uintptr_t pcidev_init(uint16_t vendor_id, int bar,
- const struct pcidev_status *devs)
+uintptr_t pcidev_init(int bar, const struct pcidev_status *devs)
{
struct pci_dev *dev;
struct pci_filter filter;
@@ -203,8 +202,7 @@ uintptr_t pcidev_init(uint16_t vendor_id, int bar,
pci_scan_bus(pacc); /* We want to get the list of devices */
pci_filter_init(pacc, &filter);
- /* Filter by vendor and also bb:dd.f (if supplied by the user). */
- filter.vendor = vendor_id;
+ /* Filter by bb:dd.f (if supplied by the user). */
pcidev_bdf = extract_programmer_param("pci");
if (pcidev_bdf != NULL) {
if ((msg = pci_filter_parse_slot(&filter, pcidev_bdf))) {
@@ -216,6 +214,9 @@ uintptr_t pcidev_init(uint16_t vendor_id, int bar,
for (dev = pacc->devices; dev; dev = dev->next) {
if (pci_filter_match(&filter, dev)) {
+ /* FIXME: We should count all matching devices, not
+ * just those with a valid BAR.
+ */
if ((addr = pcidev_validate(dev, bar, devs)) != 0) {
curaddr = addr;
pcidev_dev = dev;