summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoraugustss <augustss@NetBSD.org>2001-09-29 13:56:04 +0000
committeraugustss <augustss@NetBSD.org>2001-09-29 13:56:04 +0000
commit797a70e551f719bb388bce70c4d2753963efcb57 (patch)
tree24b37242bd8feb2d8f2b5305cf2d4d35474edbd0 /sys/dev
parenteab2fb5274dffae9687e1ac468a2bb7337b93b47 (diff)
Add a detach function (from Jared D. McNeill).
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/opl.c18
-rw-r--r--sys/dev/ic/oplvar.h4
2 files changed, 19 insertions, 3 deletions
diff --git a/sys/dev/ic/opl.c b/sys/dev/ic/opl.c
index c83f58a755b..de746489ca2 100644
--- a/sys/dev/ic/opl.c
+++ b/sys/dev/ic/opl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: opl.c,v 1.12 2001/01/18 20:28:18 jdolecek Exp $ */
+/* $NetBSD: opl.c,v 1.13 2001/09/29 13:56:04 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -169,7 +169,21 @@ opl_attach(sc)
printf(": model OPL%d\n", sc->model);
- midi_attach_mi(&midisyn_hw_if, &sc->syn, &sc->mididev.dev);
+ sc->sc_mididev =
+ midi_attach_mi(&midisyn_hw_if, &sc->syn, &sc->mididev.dev);
+}
+
+int
+opl_detach(sc, flags)
+ struct opl_softc *sc;
+ int flags;
+{
+ int rv = 0;
+
+ if (sc->sc_mididev != NULL)
+ rv = config_detach(sc->sc_mididev, flags);
+
+ return(rv);
}
static void
diff --git a/sys/dev/ic/oplvar.h b/sys/dev/ic/oplvar.h
index e4dfec6be11..fbd1c10b0cd 100644
--- a/sys/dev/ic/oplvar.h
+++ b/sys/dev/ic/oplvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: oplvar.h,v 1.5 2001/01/18 20:28:18 jdolecek Exp $ */
+/* $NetBSD: oplvar.h,v 1.6 2001/09/29 13:56:04 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -56,6 +56,7 @@ struct opl_softc {
#define OPL_2 2
#define OPL_3 3
struct midisyn syn;
+ struct device *sc_mididev;
struct opl_voice voices[OPL3_NVOICE];
int volume;
@@ -96,4 +97,5 @@ extern const struct opl_operators opl3_instrs[];
int opl_find __P((struct opl_softc *));
void opl_attach __P((struct opl_softc *));
+int opl_detach __P((struct opl_softc *, int));
#endif