Source-Changes-HG archive

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

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



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

description:
mhzc(4): Use config_detach_children.

diffstat:

 sys/dev/pcmcia/mhzc.c |  18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diffs (40 lines):

diff -r b10cc0aa99ba -r 17e6e47f51e0 sys/dev/pcmcia/mhzc.c
--- a/sys/dev/pcmcia/mhzc.c     Wed May 10 00:11:57 2023 +0000
+++ b/sys/dev/pcmcia/mhzc.c     Wed May 10 00:12:05 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mhzc.c,v 1.55 2023/01/20 01:35:03 msaitoh Exp $        */
+/*     $NetBSD: mhzc.c,v 1.56 2023/05/10 00:12:05 riastradh Exp $      */
 
 /*-
  * Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mhzc.c,v 1.55 2023/01/20 01:35:03 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mhzc.c,v 1.56 2023/05/10 00:12:05 riastradh Exp $");
 
 #include "opt_inet.h"
 
@@ -334,17 +334,11 @@ int
 mhzc_detach(device_t self, int flags)
 {
        struct mhzc_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 & MHZC_MODEM_MAPPED)



Home | Main Index | Thread Index | Old Index