Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/audio Use kmem_alloc/free() instead of old kern_mall...



details:   https://anonhg.NetBSD.org/src/rev/c02b5c0981b6
branches:  trunk
changeset: 962277:c02b5c0981b6
user:      isaki <isaki%NetBSD.org@localhost>
date:      Wed Jul 10 13:26:47 2019 +0000

description:
Use kmem_alloc/free() instead of old kern_malloc/free().

diffstat:

 sys/dev/audio/audio.c |  14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diffs (42 lines):

diff -r 7fe9212fee20 -r c02b5c0981b6 sys/dev/audio/audio.c
--- a/sys/dev/audio/audio.c     Wed Jul 10 13:17:57 2019 +0000
+++ b/sys/dev/audio/audio.c     Wed Jul 10 13:26:47 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.27 2019/07/10 13:17:57 isaki Exp $ */
+/*     $NetBSD: audio.c,v 1.28 2019/07/10 13:26:47 isaki Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -142,7 +142,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.27 2019/07/10 13:17:57 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.28 2019/07/10 13:26:47 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -4685,13 +4685,7 @@
                        return ENOMEM;
                }
        } else {
-               mixer->hwbuf.mem = kern_malloc(bufsize, M_NOWAIT);
-               if (mixer->hwbuf.mem == NULL) {
-                       device_printf(sc->sc_dev,
-                           "%s: malloc hwbuf(%zu) failed\n",
-                           __func__, bufsize);
-                       return ENOMEM;
-               }
+               mixer->hwbuf.mem = kmem_alloc(bufsize, KM_SLEEP);
        }
 
        /* From here, audio_mixer_destroy is necessary to exit. */
@@ -4811,7 +4805,7 @@
                if (sc->hw_if->freem) {
                        sc->hw_if->freem(sc->hw_hdl, mixer->hwbuf.mem, bufsize);
                } else {
-                       kern_free(mixer->hwbuf.mem);
+                       kmem_free(mixer->hwbuf.mem, bufsize);
                }
                mixer->hwbuf.mem = NULL;
        }



Home | Main Index | Thread Index | Old Index