Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev Clean up audio_allocbufs().



details:   https://anonhg.NetBSD.org/src/rev/2b7dfe52760c
branches:  trunk
changeset: 355787:2b7dfe52760c
user:      isaki <isaki%NetBSD.org@localhost>
date:      Tue Aug 15 05:11:25 2017 +0000

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

diffstat:

 sys/dev/audio.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (51 lines):

diff -r 63534f91c36f -r 2b7dfe52760c sys/dev/audio.c
--- a/sys/dev/audio.c   Tue Aug 15 05:05:32 2017 +0000
+++ b/sys/dev/audio.c   Tue Aug 15 05:11:25 2017 +0000
@@ -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 <nathanialsloss%yahoo.com.au@localhost>
@@ -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_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 @@
        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 @@
 
 /* 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;



Home | Main Index | Thread Index | Old Index