Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pcmcia xirc(4): Use config_detach_children.



details:   https://anonhg.NetBSD.org/src/rev/b5ebee88c0d7
branches:  trunk
changeset: 374706:b5ebee88c0d7
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed May 10 00:12:20 2023 +0000

description:
xirc(4): Use config_detach_children.

diffstat:

 sys/dev/pcmcia/xirc.c |  21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diffs (50 lines):

diff -r 209148ea5247 -r b5ebee88c0d7 sys/dev/pcmcia/xirc.c
--- a/sys/dev/pcmcia/xirc.c     Wed May 10 00:12:12 2023 +0000
+++ b/sys/dev/pcmcia/xirc.c     Wed May 10 00:12:20 2023 +0000
@@ -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;
+       int error;
 
-       if (sc->sc_ethernet != NULL) {
-               if ((rv = config_detach(sc->sc_ethernet, flags)) != 0)
-                       return rv;
-       }
-
-       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



Home | Main Index | Thread Index | Old Index