add null pmf handlers.

This commit is contained in:
christos 2007-12-16 19:01:35 +00:00
parent ce55394a89
commit f54e064ee9
5 changed files with 36 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: midi_pcppi.c,v 1.16 2007/10/19 12:00:20 ad Exp $ */
/* $NetBSD: midi_pcppi.c,v 1.17 2007/12/16 19:01:36 christos Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: midi_pcppi.c,v 1.16 2007/10/19 12:00:20 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: midi_pcppi.c,v 1.17 2007/12/16 19:01:36 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -114,6 +114,10 @@ midi_pcppi_attach(parent, self, aux)
midisyn_attach(&sc->sc_mididev, ms);
midi_attach(&sc->sc_mididev, parent);
if (!device_pmf_is_registered(self))
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self,
"couldn't establish power handler\n");
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcppi.c,v 1.24 2007/10/19 12:00:22 ad Exp $ */
/* $NetBSD: pcppi.c,v 1.25 2007/12/16 19:01:36 christos Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pcppi.c,v 1.24 2007/10/19 12:00:22 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: pcppi.c,v 1.25 2007/12/16 19:01:36 christos Exp $");
#include "attimer.h"
@ -165,6 +165,11 @@ pcppi_isa_attach(struct device *parent, struct device *self, void *aux)
printf("\n");
pcppi_attach(sc);
if (!device_pmf_is_registered(self))
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self,
"couldn't establish power handler\n");
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: spkr.c,v 1.25 2007/10/19 12:00:23 ad Exp $ */
/* $NetBSD: spkr.c,v 1.26 2007/12/16 19:01:36 christos Exp $ */
/*
* Copyright (c) 1990 Eric S. Raymond (esr@snark.thyrsus.com)
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.25 2007/10/19 12:00:23 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.26 2007/12/16 19:01:36 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -420,6 +420,11 @@ spkrattach(struct device *parent, struct device *self,
printf("\n");
ppicookie = ((struct pcppi_attach_args *)aux)->pa_cookie;
spkr_attached = 1;
if (!device_pmf_is_registered(self))
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self,
"couldn't establish power handler\n");
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: midi.c,v 1.58 2007/12/05 17:19:47 pooka Exp $ */
/* $NetBSD: midi.c,v 1.59 2007/12/16 19:01:35 christos Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.58 2007/12/05 17:19:47 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.59 2007/12/16 19:01:35 christos Exp $");
#include "midi.h"
#include "sequencer.h"
@ -169,6 +169,10 @@ midiattach(struct device *parent, struct device *self, void *aux)
sc->hw_if = hwp;
sc->hw_hdl = hdlp;
midi_attach(sc, parent);
if (!device_pmf_is_registered(self))
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self,
"couldn't establish power handler\n");
}
int
@ -195,6 +199,8 @@ mididetach(struct device *self, int flags)
DPRINTFN(2,("midi_detach: sc=%p flags=%d\n", sc, flags));
pmf_device_deregister(self);
sc->dying = 1;
wakeup(&sc->wchan);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ubt.c,v 1.29 2007/11/28 20:16:12 plunky Exp $ */
/* $NetBSD: ubt.c,v 1.30 2007/12/16 19:01:37 christos Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.29 2007/11/28 20:16:12 plunky Exp $");
__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.30 2007/12/16 19:01:37 christos Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -527,6 +527,10 @@ USB_ATTACH(ubt)
}
sc->sc_ok = 1;
if (!device_pmf_is_registered(self))
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self,
"couldn't establish power handler\n");
USB_ATTACH_SUCCESS_RETURN;
}
@ -537,6 +541,8 @@ USB_DETACH(ubt)
DPRINTF("sc=%p flags=%d\n", sc, flags);
pmf_device_deregister(self);
sc->sc_dying = 1;
if (!sc->sc_ok)