Register with pmf(9), tell it we don't need anything.

This commit is contained in:
uwe 2009-04-05 02:29:40 +00:00
parent c7b2923b5e
commit 4e37bb5a9c
2 changed files with 13 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pfckbd.c,v 1.26 2009/03/18 10:22:30 cegger Exp $ */
/* $NetBSD: pfckbd.c,v 1.27 2009/04/05 02:29:40 uwe Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
* currently, HP Jornada 680/690, HITACHI PERSONA HPW-50PAD only.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pfckbd.c,v 1.26 2009/03/18 10:22:30 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: pfckbd.c,v 1.27 2009/04/05 02:29:40 uwe Exp $");
#include "debug_hpcsh.h"
@ -147,6 +147,9 @@ pfckbd_attach(device_t parent, device_t self, void *aux)
callout_init(&pfckbd_core.pc_soft_ch, 0);
callout_reset(&pfckbd_core.pc_soft_ch, 1,
pfckbd_core.pc_callout, &pfckbd_core);
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "unable to establish power handler\n");
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: wdc_pcmcia.c,v 1.114 2009/03/21 12:35:17 drochner Exp $ */
/* $NetBSD: wdc_pcmcia.c,v 1.115 2009/04/05 02:35:03 uwe Exp $ */
/*-
* Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wdc_pcmcia.c,v 1.114 2009/03/21 12:35:17 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: wdc_pcmcia.c,v 1.115 2009/04/05 02:35:03 uwe Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -320,6 +320,10 @@ wdc_pcmcia_attach(device_t parent, device_t self, void *aux)
tsleep(wdc_pcmcia_attach, PWAIT, "wdcattach", hz / 2);
wdcattach(&sc->ata_channel);
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "unable to establish power handler\n");
config_pending_decr();
ata_delref(&sc->ata_channel);
sc->sc_state = WDC_PCMCIA_ATTACHED;
@ -338,6 +342,8 @@ wdc_pcmcia_detach(device_t self, int flags)
if (sc->sc_state != WDC_PCMCIA_ATTACHED)
return (0);
pmf_device_deregister(self);
if ((error = wdcdetach(self, flags)) != 0)
return (error);