Module Name: src
Committed By: uebayasi
Date: Sat Nov 1 07:54:18 UTC 2014
Modified Files:
src/sys/dev: audio.c audio_if.h
Log Message:
Revert previous.
Not only audio_attach_mi() but also audioprint() have to be separated.
midi.c has the same problem, and a little more complicated. These will be
revisited later.
To generate a diff of this commit:
cvs rdiff -u -r1.264 -r1.265 src/sys/dev/audio.c
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/audio_if.h
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.264 src/sys/dev/audio.c:1.265
--- src/sys/dev/audio.c:1.264 Sat Nov 1 05:56:36 2014
+++ src/sys/dev/audio.c Sat Nov 1 07:54:18 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.264 2014/11/01 05:56:36 uebayasi Exp $ */
+/* $NetBSD: audio.c,v 1.265 2014/11/01 07:54:18 uebayasi Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.264 2014/11/01 05:56:36 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.265 2014/11/01 07:54:18 uebayasi Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -829,6 +829,27 @@ au_setup_ports(struct audio_softc *sc, s
}
}
+/*
+ * Called from hardware driver. This is where the MI audio driver gets
+ * probed/attached to the hardware driver.
+ */
+device_t
+audio_attach_mi(const struct audio_hw_if *ahwp, void *hdlp, device_t dev)
+{
+ struct audio_attach_args arg;
+
+#ifdef DIAGNOSTIC
+ if (ahwp == NULL) {
+ aprint_error("audio_attach_mi: NULL\n");
+ return 0;
+ }
+#endif
+ arg.type = AUDIODEV_TYPE_AUDIO;
+ arg.hwif = ahwp;
+ arg.hdl = hdlp;
+ return config_found(dev, &arg, audioprint);
+}
+
#ifdef AUDIO_DEBUG
void audio_printsc(struct audio_softc *);
void audio_print_params(const char *, struct audio_params *);
Index: src/sys/dev/audio_if.h
diff -u src/sys/dev/audio_if.h:1.68 src/sys/dev/audio_if.h:1.69
--- src/sys/dev/audio_if.h:1.68 Sat Nov 1 05:56:36 2014
+++ src/sys/dev/audio_if.h Sat Nov 1 07:54:18 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: audio_if.h,v 1.68 2014/11/01 05:56:36 uebayasi Exp $ */
+/* $NetBSD: audio_if.h,v 1.69 2014/11/01 07:54:18 uebayasi Exp $ */
/*
* Copyright (c) 1994 Havard Eidnes.
@@ -254,32 +254,10 @@ struct audio_attach_args {
#define AUDIODEV_TYPE_MPU 3
#define AUDIODEV_TYPE_AUX 4
+/* Attach the MI driver(s) to the MD driver. */
+device_t audio_attach_mi(const struct audio_hw_if *, void *, device_t);
int audioprint(void *, const char *);
-/*
- * Called from hardware driver. This is where the MI audio driver gets
- * probed/attached to the hardware driver.
- *
- * This is provided as inline so that hardware drivers don't need to depend
- * on audio.c.
- */
-static inline device_t
-audio_attach_mi(const struct audio_hw_if *ahwp, void *hdlp, device_t dev)
-{
- struct audio_attach_args arg;
-
-#ifdef DIAGNOSTIC
- if (ahwp == NULL) {
- aprint_error("audio_attach_mi: NULL\n");
- return 0;
- }
-#endif
- arg.type = AUDIODEV_TYPE_AUDIO;
- arg.hwif = ahwp;
- arg.hdl = hdlp;
- return config_found(dev, &arg, audioprint);
-}
-
/* Device identity flags */
#define SOUND_DEVICE 0
#define AUDIO_DEVICE 0x80