Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci emuxki(4): Use config_detach_children.



details:   https://anonhg.NetBSD.org/src/rev/176d89f57d46
branches:  trunk
changeset: 374701:176d89f57d46
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed May 10 00:11:41 2023 +0000

description:
emuxki(4): Use config_detach_children.

diffstat:

 sys/dev/pci/emuxki.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (35 lines):

diff -r bcc2938795aa -r 176d89f57d46 sys/dev/pci/emuxki.c
--- a/sys/dev/pci/emuxki.c      Wed May 10 00:11:32 2023 +0000
+++ b/sys/dev/pci/emuxki.c      Wed May 10 00:11:41 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: emuxki.c,v 1.76 2022/09/07 03:34:43 khorben Exp $      */
+/*     $NetBSD: emuxki.c,v 1.77 2023/05/10 00:11:41 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.76 2022/09/07 03:34:43 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.77 2023/05/10 00:11:41 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -483,11 +483,12 @@ unmap:
 static int
 emuxki_detach(device_t self, int flags)
 {
-       struct emuxki_softc *sc;
+       struct emuxki_softc *sc = device_private(self);
+       int error;
 
-       sc = device_private(self);
-       if (sc->sc_audev != NULL) /* Test in case audio didn't attach */
-               config_detach(sc->sc_audev, 0);
+       error = config_detach_children(self, flags);
+       if (error)
+               return error;
 
        /* All voices should be stopped now but add some code here if not */
        emuxki_writeio_4(sc, EMU_HCFG,



Home | Main Index | Thread Index | Old Index