From c7e27a0c932305b8aa3647cc4169637da15ae448 Mon Sep 17 00:00:00 2001 From: avatar Date: Tue, 18 Aug 2015 13:16:06 +0000 Subject: [PATCH] Using the error return code documented in the comment. Though there is no direct midi_uninit() caller amongst existing drivers at this moment, a quick experiment indicates that EBUSY gives users more precise error message once drivers start to honour this result. For example, emu_midi_detach() should check the result of mpu401_uninit() and block module unloading if there is any MIDI I/O in progress. MFC after: 2 weeks --- sys/dev/sound/midi/midi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index 5537d6235b7..f95218b1c10 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -403,7 +403,7 @@ midi_uninit(struct snd_midi *m) { int err; - err = ENXIO; + err = EBUSY; mtx_lock(&midistat_lock); mtx_lock(&m->lock); if (m->busy) { -- 2.45.0