summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-02-25 22:33:23 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-02-25 22:33:23 +0000
commit2a605d2e37a48883683704ee405fbafa5922228a (patch)
tree532a4848f5823d505bd010a83c4a2571fa608d8e
parent93707a2a11910790416181d665bcf8c750d671ee (diff)
Don't tinker with the MIDI registers if they aren't mapped; necessary for the
GUS PnP.
-rw-r--r--sys/dev/isa/gus.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/isa/gus.c b/sys/dev/isa/gus.c
index b370c587cf0..d2ed7e17011 100644
--- a/sys/dev/isa/gus.c
+++ b/sys/dev/isa/gus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gus.c,v 1.34 2010/07/15 03:43:11 jakemsr Exp $ */
+/* $OpenBSD: gus.c,v 1.35 2012/02/25 22:33:22 miod Exp $ */
/* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */
/*-
@@ -2075,14 +2075,16 @@ gusreset(sc, voices)
delay(500);
/*
- * Reset MIDI port as well
+ * Reset MIDI port as well, if applicable
*/
- bus_space_write_1(iot, ioh4, GUS_MIDI_CONTROL, MIDI_RESET);
+ if (ioh4 != (bus_space_handle_t)NULL) {
+ bus_space_write_1(iot, ioh4, GUS_MIDI_CONTROL, MIDI_RESET);
- delay(500);
+ delay(500);
- bus_space_write_1(iot, ioh4, GUS_MIDI_CONTROL, 0x00);
+ bus_space_write_1(iot, ioh4, GUS_MIDI_CONTROL, 0x00);
+ }
/*
* Clear interrupts