summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2002-06-29 23:53:34 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2002-06-29 23:53:34 +0000
commit03e9e7147b2a7d2c0369608e9e03a493c9326a77 (patch)
tree9a8354934617ebc52ad39c5848b376a76eae6bad
parent205f8b0a92dfb324813bed806d350a0e96c781bc (diff)
Be sure to correctly initialize the ahc_softc members before using
ahc_inb(), to prevent an early panic. This could only affect non-i386 architectures.
-rw-r--r--sys/dev/pci/ahc_pci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/ahc_pci.c b/sys/dev/pci/ahc_pci.c
index c58e8c98877..72f5cb6cc35 100644
--- a/sys/dev/pci/ahc_pci.c
+++ b/sys/dev/pci/ahc_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ahc_pci.c,v 1.32 2002/06/28 00:34:54 smurph Exp $ */
+/* $OpenBSD: ahc_pci.c,v 1.33 2002/06/29 23:53:33 miod Exp $ */
/* $NetBSD: ahc_pci.c,v 1.9 1996/10/21 22:56:24 thorpej Exp $ */
/*
@@ -451,6 +451,8 @@ ahc_pci_map_registers(ahc)
* Do a quick test to see if memory mapped
* I/O is functioning correctly.
*/
+ ahc->tag = iot;
+ ahc->bsh = ioh;
if (ahc_inb(ahc, HCNTRL) == 0xFF) {
/* nope, use I/O mapping */
ioh_valid = 0;
@@ -542,7 +544,7 @@ ahc_do_pci_config(ahc)
if (error != 0)
return (error);
- /* Remeber how the card was setup in case there is no SEEPROM */
+ /* Remember how the card was setup in case there is no SEEPROM */
if ((ahc_inb(ahc, HCNTRL) & POWRDN) == 0) {
ahc_pause(ahc);
if ((ahc->features & AHC_ULTRA2) != 0)