aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound/midi/midi.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sound/midi/midi.c')
-rw-r--r--sys/dev/sound/midi/midi.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c
index b6ac879a118d..59ea14118f06 100644
--- a/sys/dev/sound/midi/midi.c
+++ b/sys/dev/sound/midi/midi.c
@@ -58,8 +58,23 @@ __FBSDID("$FreeBSD$");
#include <sys/poll.h>
#include <sys/sbuf.h>
#include <sys/kobj.h>
+#ifdef SND_DEBUG
+#undef KOBJMETHOD
+#define KOBJMETHOD(NAME, FUNC) \
+ { \
+ &NAME##_desc, \
+ (kobjop_t) ((FUNC != (NAME##_t *)NULL) ? FUNC : NULL) \
+ }
+#endif
+#ifndef KOBJMETHOD_END
+#define KOBJMETHOD_END { NULL, NULL }
+#endif
#include <sys/module.h>
+#ifdef HAVE_KERNEL_OPTION_HEADERS
+#include "opt_snd.h"
+#endif
+
#include <dev/sound/midi/midi.h>
#include "mpu_if.h"
@@ -145,7 +160,7 @@ static kobj_method_t midisynth_methods[] = {
KOBJMETHOD(synth_alloc, midisynth_alloc),
KOBJMETHOD(synth_controller, midisynth_controller),
KOBJMETHOD(synth_bender, midisynth_bender),
- {0, 0}
+ KOBJMETHOD_END
};
DEFINE_CLASS(midisynth, midisynth_methods, 0);
@@ -1367,6 +1382,7 @@ midi_destroy(struct snd_midi *m, int midiuninit)
MIDI_DEBUG(3, printf("midi_destroy\n"));
m->dev->si_drv1 = NULL;
+ mtx_unlock(&m->lock); /* XXX */
destroy_dev(m->dev);
TAILQ_REMOVE(&midi_devs, m, link);
if (midiuninit)
@@ -1418,6 +1434,8 @@ midi_unload()
goto exit1;
}
+ mtx_unlock(&midistat_lock); /* XXX */
+
destroy_dev(midistat_dev);
/*
* Made it here then unload is complete