summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index b70b879ab..0f62a76c1 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1,5 +1,5 @@
/*
- * $Id: pci.c,v 1.86 1998/07/15 20:34:47 mj Exp $
+ * $Id: pci.c,v 1.90 1998/09/05 12:39:39 mj Exp $
*
* PCI Bus Services, see include/linux/pci.h for further explanation.
*
@@ -138,7 +138,8 @@ __initfunc(void pci_read_bases(struct pci_dev *dev, unsigned int howmany))
if (l == 0xffffffff)
continue;
dev->base_address[reg] = l;
- if ((l & PCI_MEMORY_RANGE_TYPE_MASK) == PCI_BASE_ADDRESS_MEM_TYPE_64) {
+ if ((l & (PCI_BASE_ADDRESS_SPACE | PCI_BASE_ADDRESS_MEM_TYPE_MASK))
+ == (PCI_BASE_ADDRESS_SPACE_MEMORY | PCI_BASE_ADDRESS_MEM_TYPE_64)) {
reg++;
pci_read_config_dword(dev, PCI_BASE_ADDRESS_0 + (reg << 2), &l);
if (l) {
@@ -170,13 +171,14 @@ __initfunc(unsigned int pci_scan_bus(struct pci_bus *bus))
/* not a multi-function device */
continue;
}
- pcibios_read_config_byte(bus->number, devfn, PCI_HEADER_TYPE, &hdr_type);
+ if (pcibios_read_config_byte(bus->number, devfn, PCI_HEADER_TYPE, &hdr_type))
+ continue;
if (!PCI_FUNC(devfn))
is_multi = hdr_type & 0x80;
- pcibios_read_config_dword(bus->number, devfn, PCI_VENDOR_ID, &l);
- /* some broken boards return 0 if a slot is empty: */
- if (l == 0xffffffff || l == 0x00000000 || l == 0x0000ffff || l == 0xffff0000) {
+ if (pcibios_read_config_dword(bus->number, devfn, PCI_VENDOR_ID, &l) ||
+ /* some broken boards return 0 if a slot is empty: */
+ l == 0xffffffff || l == 0x00000000 || l == 0x0000ffff || l == 0xffff0000) {
is_multi = 0;
continue;
}