aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-04-01 16:29:28 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-04-01 16:29:28 -0700
commitd6d6789240929d938b9aabb187f46daed1741956 (patch)
tree671b91ee4f9e5e58195d796e5fbc0fa2d79a36e0
parent83ce450186a2b8ce9e7a296bf8d7dbd903f46015 (diff)
downloadsyslinux.git-syslinux-3.50-pre2.tar.gz
syslinux.git-syslinux-3.50-pre2.tar.xz
syslinux.git-syslinux-3.50-pre2.zip
Return first match in list, not first match in PCI hierarchysyslinux-3.50-pre2
Return the first match we find in the list, not the first match we can find on the PCI bus. This allows us to have more specific matches first followed by less specific matches.
-rw-r--r--com32/modules/pci.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/com32/modules/pci.c b/com32/modules/pci.c
index e907eec4..8e5b9bcc 100644
--- a/com32/modules/pci.c
+++ b/com32/modules/pci.c
@@ -46,14 +46,14 @@ struct match *find_pci_device(s_pci_device_list * pci_device_list,
int pci_dev;
uint32_t did, sid;
struct match *m;
- for (pci_dev = 0; pci_dev < pci_device_list->count; pci_dev++) {
- s_pci_device *pci_device =
- &pci_device_list->pci_device[pci_dev];
- sid =
- ((pci_device->sub_product) << 16 | (pci_device->
- sub_vendor));
- did = ((pci_device->product << 16) | (pci_device->vendor));
- for (m = list; m; m = m->next) {
+ for (m = list; m; m = m->next) {
+ for (pci_dev = 0; pci_dev < pci_device_list->count; pci_dev++) {
+ s_pci_device *pci_device =
+ &pci_device_list->pci_device[pci_dev];
+ sid =
+ ((pci_device->sub_product) << 16 | (pci_device->
+ sub_vendor));
+ did = ((pci_device->product << 16) | (pci_device->vendor));
if (((did ^ m->did) & m->did_mask) == 0 &&
((sid ^ m->sid) & m->sid_mask) == 0 &&
pci_device->revision >= m->rid_min