diff --git a/sys/dev/i2c/ims.c b/sys/dev/i2c/ims.c index b2e82f42d652..01f8bc82f4e2 100644 --- a/sys/dev/i2c/ims.c +++ b/sys/dev/i2c/ims.c @@ -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 -__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 #include @@ -146,16 +146,15 @@ ims_attach(device_t parent, device_t self, void *aux) 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