Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c ims(4): Use config_detach_children.



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

description:
ims(4): Use config_detach_children.

diffstat:

 sys/dev/i2c/ims.c |  15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diffs (40 lines):

diff -r bcdabb8d3038 -r c30374b54368 sys/dev/i2c/ims.c
--- a/sys/dev/i2c/ims.c Wed May 10 00:09:54 2023 +0000
+++ b/sys/dev/i2c/ims.c Wed May 10 00:10:02 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ims.c,v 1.4 2022/01/14 22:28:42 riastradh Exp $ */
+/* $NetBSD: ims.c,v 1.5 2023/05/10 00:10:02 riastradh Exp $ */
 /* $OpenBSD ims.c,v 1.1 2016/01/12 01:11:15 jcs Exp $ */
 
 /*
@@ -20,7 +20,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ims.c,v 1.4 2022/01/14 22:28:42 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ims.c,v 1.5 2023/05/10 00:10:02 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -146,16 +146,15 @@ ims_attach(device_t parent, device_t sel
 static int
 ims_detach(device_t self, int flags)
 {
-       struct ims_softc *sc = device_private(self);
-       int rv = 0;
+       int error;
 
        /* No need to do reference counting of ums, wsmouse has all the goo. */
-       if (sc->sc_ms.hidms_wsmousedev != NULL)
-               rv = config_detach(sc->sc_ms.hidms_wsmousedev, flags);
+       error = config_detach_children(self, flags);
+       if (error)
+               return error;
 
        pmf_device_deregister(self);
-
-       return rv;
+       return 0;
 }
 
 void



Home | Main Index | Thread Index | Old Index