Module Name:    src
Committed By:   isaki
Date:           Tue Aug 15 05:11:25 UTC 2017

Modified Files:
        src/sys/dev: audio.c

Log Message:
Clean up audio_allocbufs().
As a result of sc_audiochan cleanup, it is easy to access sc_hwvc.


To generate a diff of this commit:
cvs rdiff -u -r1.395 -r1.396 src/sys/dev/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.c
diff -u src/sys/dev/audio.c:1.395 src/sys/dev/audio.c:1.396
--- src/sys/dev/audio.c:1.395	Tue Aug 15 05:05:32 2017
+++ src/sys/dev/audio.c	Tue Aug 15 05:11:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.395 2017/08/15 05:05:32 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.396 2017/08/15 05:11:25 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss <nathanialsl...@yahoo.com.au>
@@ -148,7 +148,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.395 2017/08/15 05:05:32 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.396 2017/08/15 05:11:25 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -279,7 +279,7 @@ void	audio_calc_blksize(struct audio_sof
 void	audio_fill_silence(const struct audio_params *, uint8_t *, int);
 int	audio_silence_copyout(struct audio_softc *, int, struct uio *);
 
-static int	audio_allocbufs(struct audio_softc *, struct virtual_channel *);
+static int	audio_allocbufs(struct audio_softc *);
 void	audio_init_ringbuffer(struct audio_softc *,
 			      struct audio_ringbuffer *, int);
 int	audio_initbufs(struct audio_softc *, struct virtual_channel *);
@@ -592,7 +592,7 @@ audioattach(device_t parent, device_t se
 	aprint_normal("\n");
 
 	mutex_enter(sc->sc_lock);
-	if (audio_allocbufs(sc, vc) != 0) {
+	if (audio_allocbufs(sc) != 0) {
 		aprint_error_dev(sc->sc_dev,
 			"could not allocate ring buffer\n");
 		mutex_exit(sc->sc_lock);
@@ -1107,10 +1107,13 @@ audio_print_params(const char *s, struct
 
 /* Allocate all ring buffers. called from audioattach() */
 static int
-audio_allocbufs(struct audio_softc *sc, struct virtual_channel *vc)
+audio_allocbufs(struct audio_softc *sc)
 {
+	struct virtual_channel *vc;
 	int error;
 
+	vc = sc->sc_hwvc;
+
 	sc->sc_pr.s.start = NULL;
 	vc->sc_mpr.s.start = NULL;
 	sc->sc_rr.s.start = NULL;

Reply via email to