Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci ismt(4): Use config_detach_children.



details:   https://anonhg.NetBSD.org/src/rev/b10cc0aa99ba
branches:  trunk
changeset: 374703:b10cc0aa99ba
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed May 10 00:11:57 2023 +0000

description:
ismt(4): Use config_detach_children.

diffstat:

 sys/dev/pci/ismt.c |  18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diffs (44 lines):

diff -r fb095195aa72 -r b10cc0aa99ba sys/dev/pci/ismt.c
--- a/sys/dev/pci/ismt.c        Wed May 10 00:11:49 2023 +0000
+++ b/sys/dev/pci/ismt.c        Wed May 10 00:11:57 2023 +0000
@@ -60,7 +60,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ismt/ismt.c 266474 2014-05-20 19:55:06Z jimharris $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: ismt.c,v 1.9 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ismt.c,v 1.10 2023/05/10 00:11:57 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -623,16 +623,14 @@ ismt_bread(struct ismt_softc *sc, i2c_ad
 static int
 ismt_detach(device_t self, int flags)
 {
-       struct ismt_softc       *sc;
-       int rv = 0;
+       struct ismt_softc *sc = device_private(self);
+       int error;
 
        ISMT_DEBUG(self, "%s\n", __func__);
-       sc = device_private(self);
-       if (sc->smbdev != NULL) {
-               rv = config_detach(sc->smbdev, flags);
-               if (rv != 0)
-                       return rv;
-       }
+       error = config_detach_children(self, flags);
+       if (error)
+               return error;
+
        if (sc->sc_ih != NULL) {
                pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
                sc->sc_ih = NULL;
@@ -653,7 +651,7 @@ ismt_detach(device_t self, int flags)
                bus_space_unmap(sc->mmio_tag, sc->mmio_handle, sc->mmio_size);
 
        iic_tag_fini(&sc->sc_i2c_tag);
-       return rv;
+       return 0;
 }
 
 static void



Home | Main Index | Thread Index | Old Index