Module Name: src
Committed By: isaki
Date: Sat Mar 7 06:27:19 UTC 2020
Modified Files:
src/sys/dev/audio: audio.c
Log Message:
Fix/Update comments about allocm/freem.
To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/audio/audio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.63 src/sys/dev/audio/audio.c:1.64
--- src/sys/dev/audio/audio.c:1.63 Sat Mar 7 06:25:57 2020
+++ src/sys/dev/audio/audio.c Sat Mar 7 06:27:19 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.63 2020/03/07 06:25:57 isaki Exp $ */
+/* $NetBSD: audio.c,v 1.64 2020/03/07 06:27:19 isaki Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -118,8 +118,8 @@
* set_port - x +
* get_port - x +
* query_devinfo - x
- * allocm - - + (*1)
- * freem - - + (*1)
+ * allocm - - +
+ * freem - - +
* round_buffersize - x
* get_props - - Called at attach time
* trigger_output x x +
@@ -127,10 +127,6 @@
* dev_ioctl - x
* get_locks - - Called at attach time
*
- * *1 Note: Before 8.0, since these have been called only at attach time,
- * neither lock were necessary. Currently, on the other hand, since
- * these may be also called after attach, the thread lock is required.
- *
* In addition, there is an additional lock.
*
* - track->lock. This is an atomic variable and is similar to the
@@ -142,7 +138,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.63 2020/03/07 06:25:57 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.64 2020/03/07 06:27:19 isaki Exp $");
#ifdef _KERNEL_OPT
#include "audio.h"
@@ -4887,10 +4883,8 @@ audio_mixer_init(struct audio_softc *sc,
bufsize);
mixer->hwbuf.capacity = capacity;
- /*
- * XXX need to release sc_lock for compatibility?
- */
if (sc->hw_if->allocm) {
+ /* sc_lock is not necessary for allocm */
mixer->hwbuf.mem = sc->hw_if->allocm(sc->hw_hdl, mode, bufsize);
if (mixer->hwbuf.mem == NULL) {
device_printf(sc->sc_dev, "%s: allocm(%zu) failed\n",
@@ -5009,6 +5003,7 @@ audio_mixer_destroy(struct audio_softc *
if (mixer->hwbuf.mem != NULL) {
if (sc->hw_if->freem) {
+ /* sc_lock is not necessary for freem */
sc->hw_if->freem(sc->hw_hdl, mixer->hwbuf.mem, bufsize);
} else {
kmem_free(mixer->hwbuf.mem, bufsize);