summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2023-05-10 00:11:49 +0000
committerriastradh <riastradh@NetBSD.org>2023-05-10 00:11:49 +0000
commit3a8f888cb9f2268d569a61b2c306cc53f1a7ced2 (patch)
tree1267498659638df021d70e651734aeb57d5e76f1 /sys/dev
parenta9d3729382bf20efda2402426f98e12c52c42b14 (diff)
esa(4): Use config_detach_children.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/esa.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/dev/pci/esa.c b/sys/dev/pci/esa.c
index 429f5be5448..0d2ce4cb9de 100644
--- a/sys/dev/pci/esa.c
+++ b/sys/dev/pci/esa.c
@@ -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>
@@ -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 child)
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);