summaryrefslogtreecommitdiff
path: root/sys/arch/macppc
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-03-15 21:10:38 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-03-15 21:10:38 +0000
commitafafedd10667d1967791831ae2df6b34365dd988 (patch)
tree92e10444be172235f936f1b72e3aca5fb2d1961b /sys/arch/macppc
parent06d07131484e3f848b7997213ae867f6ff545e00 (diff)
Skip empty pci ranges rather than aborting probe, as done on sparc64.
ok drahn@
Diffstat (limited to 'sys/arch/macppc')
-rw-r--r--sys/arch/macppc/pci/vgafb_pci.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/sys/arch/macppc/pci/vgafb_pci.c b/sys/arch/macppc/pci/vgafb_pci.c
index 205edb0bcd3..c5bc4e29b1a 100644
--- a/sys/arch/macppc/pci/vgafb_pci.c
+++ b/sys/arch/macppc/pci/vgafb_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vgafb_pci.c,v 1.14 2003/11/12 20:08:31 miod Exp $ */
+/* $OpenBSD: vgafb_pci.c,v 1.15 2005/03/15 21:10:37 miod Exp $ */
/* $NetBSD: vga_pci.c,v 1.4 1996/12/05 01:39:38 cgd Exp $ */
/*
@@ -111,13 +111,12 @@ vgafb_pci_probe(struct pci_attach_args *pa, int id, u_int32_t *ioaddr,
PCI_MAPREG_TYPE_IO) {
retval = pci_io_find(pc, pa->pa_tag, i,
&addr, &size);
+ if (retval != 0) {
+ continue;
+ }
#ifdef DEBUG_VGAFB
printf("vgafb_pci_probe: io %x addr %x size %x\n", i, addr, size);
#endif
-
- if (retval) {
- return 0;
- }
if (*iosize == 0) {
*ioaddr = addr;
*iosize = size;
@@ -126,13 +125,12 @@ vgafb_pci_probe(struct pci_attach_args *pa, int id, u_int32_t *ioaddr,
} else {
retval = pci_mem_find(pc, pa->pa_tag, i,
&addr, &size, &tcacheable);
+ if (retval != 0) {
+ continue;
+ }
#ifdef DEBUG_VGAFB
printf("vgafb_pci_probe: mem %x addr %x size %x\n", i, addr, size);
#endif
-
- if (retval) {
- return 0;
- }
if (size == 0 || addr == 0) {
/* ignore this entry */
} else if (*memsize == 0) {
@@ -214,14 +212,19 @@ vgafb_pci_probe(struct pci_attach_args *pa, int id, u_int32_t *ioaddr,
} else {
/* iospace not available, assume 640x480, pray */
*ioaddr = 0;
- *iosize=0;
+ *iosize = 0;
}
}
#ifdef DEBUG_VGAFB
printf("vgafb_pci_probe: id %x ioaddr %x, iosize %x, memaddr %x,\n memsize %x, mmioaddr %x, mmiosize %x\n",
id, *ioaddr, *iosize, *memaddr, *memsize, *mmioaddr, *mmiosize);
#endif
- return 1;
+
+ /* io and mmio spaces are not required to attach */
+ if (/* *iosize == 0 || */ *memsize == 0 /* || *mmiosize == 0 */)
+ return (0);
+
+ return (1);
}
int