Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Include sequencer code conditionally. Fixes build f...



details:   https://anonhg.NetBSD.org/src/rev/d18bd3640f81
branches:  trunk
changeset: 366646:d18bd3640f81
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Jun 04 20:12:10 2022 +0000

description:
Include sequencer code conditionally.  Fixes build for sparc and sparc64
(and anything else that has a midi but no sequencer).

diffstat:

 sys/dev/files.audio    |   6 +++---
 sys/dev/midi_seq_mod.c |  20 ++++++++++++++++++--
 2 files changed, 21 insertions(+), 5 deletions(-)

diffs (85 lines):

diff -r 40314a1ba3d5 -r d18bd3640f81 sys/dev/files.audio
--- a/sys/dev/files.audio       Sat Jun 04 03:32:04 2022 +0000
+++ b/sys/dev/files.audio       Sat Jun 04 20:12:10 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.audio,v 1.15 2022/06/04 03:31:10 pgoyette Exp $
+#      $NetBSD: files.audio,v 1.16 2022/06/04 20:12:10 pgoyette Exp $
 
 defparam opt_audio.h   AUDIO_BLK_MS
 
@@ -28,6 +28,6 @@
 file   dev/midi_seq_mod.c              midi | sequencer        needs-flag
 file   dev/midictl.c                   midisyn
 file   dev/midisyn.c                   midisyn
-file   dev/sequencer.c                 midi | sequencer        needs-flag
-file   dev/sequencer_mod.c             midi | sequencer        needs-flag
+file   dev/sequencer.c                 sequencer               needs-flag
+file   dev/sequencer_mod.c             sequencer               needs-flag
 file   dev/spkr_audio.c                spkr_audio              needs-flag
diff -r 40314a1ba3d5 -r d18bd3640f81 sys/dev/midi_seq_mod.c
--- a/sys/dev/midi_seq_mod.c    Sat Jun 04 03:32:04 2022 +0000
+++ b/sys/dev/midi_seq_mod.c    Sat Jun 04 20:12:10 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: midi_seq_mod.c,v 1.1 2022/06/04 03:31:10 pgoyette Exp $        */
+/*     $NetBSD: midi_seq_mod.c,v 1.2 2022/06/04 20:12:10 pgoyette Exp $        */
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: midi_seq_mod.c,v 1.1 2022/06/04 03:31:10 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: midi_seq_mod.c,v 1.2 2022/06/04 20:12:10 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "midi.h"
@@ -85,32 +85,48 @@
 #ifdef _MODULE
        switch (cmd) {
        case MODULE_CMD_INIT:
+#if NMIDI > 0
                error = devsw_attach(midi_cd.cd_name, NULL, &midi_bmajor,
                    &midi_cdevsw, &midi_cmajor);
                if (error)
                        break;
+#endif
 
+#if NSEQUENCER > 0
                error = devsw_attach(sequencer_cd.cd_name,
                    NULL, &sequencer_bmajor,
                    &sequencer_cdevsw, &sequencer_cmajor);
                if (error) {
+#if NMIDI > 0
                        devsw_detach(NULL, &midi_cdevsw);
+#endif
                        break;
                }
+#endif
 
+#if NMIDI > 0
                error = config_init_component(cfdriver_ioconf_midi_seq,
                    cfattach_ioconf_midi_seq, cfdata_ioconf_midi_seq);
                if (error) {
+#if NSEQUENCER > 0
                        devsw_detach(NULL, &sequencer_cdevsw);
+#endif
                        devsw_detach(NULL, &midi_cdevsw);
+#endif
                }
                break;
        case MODULE_CMD_FINI:
+#if NMIDI > 0
                error = config_fini_component(cfdriver_ioconf_midi_seq,
                   cfattach_ioconf_midi_seq, cfdata_ioconf_midi_seq);
                if (error == 0) {
+#endif
+#if NSEQUENCER > 0
                        devsw_detach(NULL, &sequencer_cdevsw);
+#endif
+#if NMIDI > 0
                        devsw_detach(NULL, &midi_cdevsw);
+#endif
                }
                break;
        default:



Home | Main Index | Thread Index | Old Index