Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/audio Fix/Update comments about allocm/freem.
details: https://anonhg.NetBSD.org/src/rev/131ed1b06ca5
branches: trunk
changeset: 1007984:131ed1b06ca5
user: isaki <isaki%NetBSD.org@localhost>
date: Sat Mar 07 06:27:19 2020 +0000
description:
Fix/Update comments about allocm/freem.
diffstat:
sys/dev/audio/audio.c | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diffs (60 lines):
diff -r 2253ba6d59b1 -r 131ed1b06ca5 sys/dev/audio/audio.c
--- a/sys/dev/audio/audio.c Sat Mar 07 06:25:57 2020 +0000
+++ b/sys/dev/audio/audio.c Sat Mar 07 06:27:19 2020 +0000
@@ -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 @@
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 @@
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);
Home |
Main Index |
Thread Index |
Old Index