From 8a19ab6bca653c0b84e59e3814442bd60801ab61 Mon Sep 17 00:00:00 2001 From: cegger Date: Fri, 11 Apr 2008 13:00:47 +0000 Subject: [PATCH] convert to pmf(9) ok jmcneill --- sys/dev/isa/sbdsp.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/sys/dev/isa/sbdsp.c b/sys/dev/isa/sbdsp.c index 3ad5ef08e800..7c6dd673022e 100644 --- a/sys/dev/isa/sbdsp.c +++ b/sys/dev/isa/sbdsp.c @@ -1,4 +1,4 @@ -/* $NetBSD: sbdsp.c,v 1.129 2008/04/01 20:44:29 xtraeme Exp $ */ +/* $NetBSD: sbdsp.c,v 1.130 2008/04/11 13:00:47 cegger Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -81,7 +81,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sbdsp.c,v 1.129 2008/04/01 20:44:29 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sbdsp.c,v 1.130 2008/04/11 13:00:47 cegger Exp $"); #include "midi.h" #include "mpu.h" @@ -231,7 +231,7 @@ static int sbdsp_adjust(int, int); int sbdsp_midi_intr(void *); -static void sbdsp_powerhook(int, void*); +static bool sbdsp_resume(device_t PMF_FN_PROTO); #ifdef AUDIO_DEBUG void sb_printsc(struct sbdsp_softc *); @@ -441,23 +441,19 @@ sbdsp_attach(struct sbdsp_softc *sc) } } - powerhook_establish(device_xname(sc->sc_dev), sbdsp_powerhook, sc); + if (!pmf_device_register(sc->sc_dev, NULL, sbdsp_resume)) + aprint_error_dev(sc->sc_dev, "couldn't establish power handler\n"); } -static void -sbdsp_powerhook(int why, void *arg) +static bool +sbdsp_resume(device_t dv PMF_FN_ARGS) { - struct sbdsp_softc *sc; - int i; - - sc = arg; - if (!sc || why != PWR_RESUME) - return; + struct sbdsp_softc *sc = device_private(dv); /* Reset the mixer. */ sbdsp_mix_write(sc, SBP_MIX_RESET, SBP_MIX_RESET); - for (i = 0; i < SB_NDEVS; i++) - sbdsp_set_mixer_gain (sc, i); + + return true; } void