aboutsummaryrefslogtreecommitdiff
path: root/src/pci.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2008-07-09 22:43:23 -0400
committerKevin O'Connor <kevin@koconnor.net>2008-07-09 22:43:23 -0400
commit71c577685e08fa7bb66028887c0e8bb2ecf76f5b (patch)
treed908f24c8371fef3939ad80f213708994f26420d /src/pci.c
parenta68aeaf68c152a602e048256811f5b10e8d02d6e (diff)
downloadseabios-hppa-71c577685e08fa7bb66028887c0e8bb2ecf76f5b.zip
seabios-hppa-71c577685e08fa7bb66028887c0e8bb2ecf76f5b.tar.gz
seabios-hppa-71c577685e08fa7bb66028887c0e8bb2ecf76f5b.tar.bz2
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.
Diffstat (limited to 'src/pci.c')
-rw-r--r--src/pci.c3
1 files changed, 1 insertions, 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--;