Module Name: src Committed By: riastradh Date: Wed May 10 00:10:02 UTC 2023
Modified Files: src/sys/dev/i2c: ims.c Log Message: ims(4): Use config_detach_children. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/ims.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/i2c/ims.c diff -u src/sys/dev/i2c/ims.c:1.4 src/sys/dev/i2c/ims.c:1.5 --- src/sys/dev/i2c/ims.c:1.4 Fri Jan 14 22:28:42 2022 +++ src/sys/dev/i2c/ims.c Wed May 10 00:10:02 2023 @@ -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