summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2023-05-10 00:12:20 +0000
committerriastradh <riastradh@NetBSD.org>2023-05-10 00:12:20 +0000
commitaba482e87cb7bdb7600de9cd8a85966400650237 (patch)
treebda798f9efee13074571cff9f732fe55d6586bdf /sys/dev
parent9380472bec847ae1b034f8ecbc229b3a762e88f8 (diff)
xirc(4): Use config_detach_children.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pcmcia/xirc.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/sys/dev/pcmcia/xirc.c b/sys/dev/pcmcia/xirc.c
index 66aba083349..6d1212939ed 100644
--- a/sys/dev/pcmcia/xirc.c
+++ b/sys/dev/pcmcia/xirc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: xirc.c,v 1.38 2021/08/07 16:19:15 thorpej Exp $ */
+/* $NetBSD: xirc.c,v 1.39 2023/05/10 00:12:20 riastradh Exp $ */
/*-
* Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xirc.c,v 1.38 2021/08/07 16:19:15 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xirc.c,v 1.39 2023/05/10 00:12:20 riastradh Exp $");
#include "opt_inet.h"
@@ -396,17 +396,11 @@ int
xirc_detach(device_t self, int flags)
{
struct xirc_softc *sc = device_private(self);
- int rv;
-
- if (sc->sc_ethernet != NULL) {
- if ((rv = config_detach(sc->sc_ethernet, flags)) != 0)
- return rv;
- }
+ int error;
- if (sc->sc_modem != NULL) {
- if ((rv = config_detach(sc->sc_modem, flags)) != 0)
- return rv;
- }
+ error = config_detach_children(self, flags);
+ if (error)
+ return error;
/* Unmap our i/o windows. */
if (sc->sc_flags & XIRC_ETHERNET_MAPPED)
@@ -420,8 +414,7 @@ xirc_detach(device_t self, int flags)
if (sc->sc_flags & XIRC_MODEM_ALLOCED)
pcmcia_io_free(sc->sc_pf, &sc->sc_modem_pcioh);
sc->sc_flags = 0;
-
- return (0);
+ return 0;
}
int