From owner-svn-src-stable-7@freebsd.org Wed Sep 16 11:32:29 2015 Return-Path: Delivered-To: svn-src-stable-7@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC5A99CEACE; Wed, 16 Sep 2015 11:32:29 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FAD5154E; Wed, 16 Sep 2015 11:32:29 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8GBWTPG055930; Wed, 16 Sep 2015 11:32:29 GMT (envelope-from avatar@FreeBSD.org) Received: (from avatar@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8GBWTZa055929; Wed, 16 Sep 2015 11:32:29 GMT (envelope-from avatar@FreeBSD.org) Message-Id: <201509161132.t8GBWTZa055929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avatar set sender to avatar@FreeBSD.org using -f From: Tai-hwa Liang Date: Wed, 16 Sep 2015 11:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r287858 - stable/7/sys/dev/sound/midi X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2015 11:32:29 -0000 Author: avatar Date: Wed Sep 16 11:32:28 2015 New Revision: 287858 URL: https://svnweb.freebsd.org/changeset/base/287858 Log: MFC r286886: Fixing typo as well as improving readability of a few comments. Modified: stable/7/sys/dev/sound/midi/midi.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/sound/midi/midi.c ============================================================================== --- stable/7/sys/dev/sound/midi/midi.c Wed Sep 16 11:06:07 2015 (r287857) +++ stable/7/sys/dev/sound/midi/midi.c Wed Sep 16 11:32:28 2015 (r287858) @@ -86,7 +86,7 @@ enum midi_states { }; /* - * The MPU interface current has init() uninit() inqsize(( outqsize() + * The MPU interface current has init() uninit() inqsize() outqsize() * callback() : fiddle with the tx|rx status. */ @@ -160,10 +160,15 @@ DEFINE_CLASS(midisynth, midisynth_method /* * Module Exports & Interface * - * struct midi_chan *midi_init(MPU_CLASS cls, int unit, int chan) int - * midi_uninit(struct snd_midi *) 0 == no error EBUSY or other error int - * Midi_in(struct midi_chan *, char *buf, int count) int Midi_out(struct - * midi_chan *, char *buf, int count) + * struct midi_chan *midi_init(MPU_CLASS cls, int unit, int chan, + * void *cookie) + * int midi_uninit(struct snd_midi *) + * + * 0 == no error + * EBUSY or other error + * + * int midi_in(struct snd_midi *, char *buf, int count) + * int midi_out(struct snd_midi *, char *buf, int count) * * midi_{in,out} return actual size transfered * @@ -388,7 +393,7 @@ err0: mtx_unlock(&midistat_lock); /* * midi_uninit does not call MIDI_UNINIT, as since this is the implementors - * entry point. midi_unint if fact, does not send any methods. A call to + * entry point. midi_uninit if fact, does not send any methods. A call to * midi_uninit is a defacto promise that you won't manipulate ch anymore * */ From owner-svn-src-stable-7@freebsd.org Thu Sep 17 00:19:28 2015 Return-Path: Delivered-To: svn-src-stable-7@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9B639CD5BE; Thu, 17 Sep 2015 00:19:28 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99AA51DA1; Thu, 17 Sep 2015 00:19:28 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8H0JS4H074738; Thu, 17 Sep 2015 00:19:28 GMT (envelope-from avatar@FreeBSD.org) Received: (from avatar@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8H0JS16074737; Thu, 17 Sep 2015 00:19:28 GMT (envelope-from avatar@FreeBSD.org) Message-Id: <201509170019.t8H0JS16074737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avatar set sender to avatar@FreeBSD.org using -f From: Tai-hwa Liang Date: Thu, 17 Sep 2015 00:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r287888 - stable/7/sys/dev/sound/midi X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2015 00:19:28 -0000 Author: avatar Date: Thu Sep 17 00:19:27 2015 New Revision: 287888 URL: https://svnweb.freebsd.org/changeset/base/287888 Log: MFC r286887: 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. Modified: stable/7/sys/dev/sound/midi/midi.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/sound/midi/midi.c ============================================================================== --- stable/7/sys/dev/sound/midi/midi.c Thu Sep 17 00:17:32 2015 (r287887) +++ stable/7/sys/dev/sound/midi/midi.c Thu Sep 17 00:19:27 2015 (r287888) @@ -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) {