From 71c577685e08fa7bb66028887c0e8bb2ecf76f5b Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 9 Jul 2008 22:43:23 -0400 Subject: [PATCH] Fix error in pci_find_class(). Fix biterror - must shift value read from pci space - otherwise stray bits may be set and cause comparison to fail. --- src/pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pci.c b/src/pci.c index e704444..efcab46 100644 --- a/src/pci.c +++ b/src/pci.c @@ -80,12 +80,11 @@ int pci_find_class(u32 classid, int index, PCIDevice *dev) { int devfn, bus; - u32 id = classid << 8; for (bus=0; bus < MAX_BUS; bus++) { for (devfn=0; devfn<0x100; devfn++) { PCIDevice d = pci_bd(bus, devfn); u32 v = pci_config_readl(d, 0x08); - if (v != id) + if ((v>>8) != classid) continue; if (index) { index--; -- 2.25.1