Register with pmf

This commit is contained in:
jmcneill 2007-12-11 03:45:57 +00:00
parent 49c8589969
commit 8eeb638b73
2 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhidev.c,v 1.37 2007/12/01 23:40:29 jmcneill Exp $ */
/* $NetBSD: uhidev.c,v 1.38 2007/12/11 03:45:57 jmcneill Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.37 2007/12/01 23:40:29 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.38 2007/12/11 03:45:57 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -123,6 +123,9 @@ USB_ATTACH(uhidev)
devinfop, id->bInterfaceClass, id->bInterfaceSubClass);
usbd_devinfo_free(devinfop);
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
(void)usbd_set_idle(iface, 0, 0);
#if 0
@ -400,6 +403,8 @@ USB_DETACH(uhidev)
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
USBDEV(sc->sc_dev));
pmf_device_deregister(self);
return (rv);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ums.c,v 1.69 2007/12/01 23:40:29 jmcneill Exp $ */
/* $NetBSD: ums.c,v 1.70 2007/12/11 03:45:57 jmcneill Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.69 2007/12/01 23:40:29 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.70 2007/12/11 03:45:57 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -170,6 +170,9 @@ ums_attach(struct device *parent, struct device *self, void *aux)
uhidev_get_report_desc(uha->parent, &desc, &size);
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
uha->reportid, hid_input, &sc->sc_loc_x, &flags)) {
aprint_error("\n%s: mouse has no X report\n",
@ -306,6 +309,8 @@ ums_detach(struct device *self, int flags)
if (sc->sc_wsmousedev != NULL)
rv = config_detach(sc->sc_wsmousedev, flags);
pmf_device_deregister(self);
return (rv);
}