ims(4): Use config_detach_children.

This commit is contained in:
riastradh 2023-05-10 00:10:02 +00:00
parent 561e6c8bfb
commit 0e28bc09c1
1 changed files with 7 additions and 8 deletions

View File

@ -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 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