Module Name: src
Committed By: riastradh
Date: Wed May 10 00:12:20 UTC 2023
Modified Files:
src/sys/dev/pcmcia: xirc.c
Log Message:
xirc(4): Use config_detach_children.
To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pcmcia/xirc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pcmcia/xirc.c
diff -u src/sys/dev/pcmcia/xirc.c:1.38 src/sys/dev/pcmcia/xirc.c:1.39
--- src/sys/dev/pcmcia/xirc.c:1.38 Sat Aug 7 16:19:15 2021
+++ src/sys/dev/pcmcia/xirc.c Wed May 10 00:12:20 2023
@@ -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