Source-Changes-HG archive

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

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



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

description:
esa(4): Use config_detach_children.

diffstat:

 sys/dev/pci/esa.c |  16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diffs (38 lines):

diff -r 176d89f57d46 -r fb095195aa72 sys/dev/pci/esa.c
--- a/sys/dev/pci/esa.c Wed May 10 00:11:41 2023 +0000
+++ b/sys/dev/pci/esa.c Wed May 10 00:11:49 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: esa.c,v 1.65 2019/06/08 08:02:38 isaki Exp $ */
+/* $NetBSD: esa.c,v 1.66 2023/05/10 00:11:49 riastradh Exp $ */
 
 /*
  * Copyright (c) 2001-2008 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.65 2019/06/08 08:02:38 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.66 2023/05/10 00:11:49 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/errno.h>
@@ -1100,14 +1100,12 @@ esa_childdet(device_t self, device_t chi
 static int
 esa_detach(device_t self, int flags)
 {
-       struct esa_softc *sc;
-       int i;
+       struct esa_softc *sc = device_private(self);
+       int error;
 
-       sc = device_private(self);
-       for (i = 0; i < ESA_NUM_VOICES; i++) {
-               if (sc->sc_audiodev[i] != NULL)
-                       config_detach(sc->sc_audiodev[i], flags);
-       }
+       error = config_detach_children(self, flags);
+       if (error)
+               return error;
 
        if (sc->sc_ih != NULL)
                pci_intr_disestablish(sc->sc_pct, sc->sc_ih);



Home | Main Index | Thread Index | Old Index