Module Name:    src
Committed By:   tsutsui
Date:           Thu Sep 24 14:09:18 UTC 2009

Modified Files:
        src/sys/arch/sgimips/hpc: haltwo.c haltwovar.h

Log Message:
Replace shutdownhook_establish(9) (which was added by me)
with pmf_device_register1(9).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/sgimips/hpc/haltwo.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sgimips/hpc/haltwovar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sgimips/hpc/haltwo.c
diff -u src/sys/arch/sgimips/hpc/haltwo.c:1.16 src/sys/arch/sgimips/hpc/haltwo.c:1.17
--- src/sys/arch/sgimips/hpc/haltwo.c:1.16	Thu May 14 01:06:15 2009
+++ src/sys/arch/sgimips/hpc/haltwo.c	Thu Sep 24 14:09:18 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: haltwo.c,v 1.16 2009/05/14 01:06:15 macallan Exp $ */
+/* $NetBSD: haltwo.c,v 1.17 2009/09/24 14:09:18 tsutsui Exp $ */
 
 /*
  * Copyright (c) 2003 Ilpo Ruotsalainen
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: haltwo.c,v 1.16 2009/05/14 01:06:15 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: haltwo.c,v 1.17 2009/09/24 14:09:18 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -75,7 +75,7 @@
 	void *, const audio_params_t *);
 static int haltwo_trigger_input(void *, void *, void *, int, void (*)(void *),
 	void *, const audio_params_t *);
-static void haltwo_shutdown(void *);
+static bool haltwo_shutdown(device_t, int);
 
 static const struct audio_hw_if haltwo_hw_if = {
 	NULL, /* open */
@@ -358,10 +358,9 @@
 
 	audio_attach_mi(&haltwo_hw_if, sc, &sc->sc_dev);
 
-	sc->sc_sdhook = shutdownhook_establish(haltwo_shutdown, sc);
-	if (sc->sc_sdhook == NULL)
+	if (!pmf_device_register1(self, NULL, NULL, haltwo_shutdown))
 		aprint_error_dev(self,
-		    "WARNING: unable to establish shutdown hook\n");
+		    "couldn't establish power handler\n");
 }
 
 static int
@@ -815,12 +814,15 @@
 	return ENXIO;
 }
 
-void
-haltwo_shutdown(void *arg)
+bool
+haltwo_shutdown(device_t self, int howto)
 {
-	struct haltwo_softc *sc = arg;
+	struct haltwo_softc *sc;
 
+	sc = device_private(self);
 	haltwo_write(sc, ctl, HAL2_REG_CTL_ISR, 0);
 	haltwo_write(sc, ctl, HAL2_REG_CTL_ISR,
 	    HAL2_ISR_GLOBAL_RESET_N | HAL2_ISR_CODEC_RESET_N);
+
+	return true;
 }

Index: src/sys/arch/sgimips/hpc/haltwovar.h
diff -u src/sys/arch/sgimips/hpc/haltwovar.h:1.5 src/sys/arch/sgimips/hpc/haltwovar.h:1.6
--- src/sys/arch/sgimips/hpc/haltwovar.h:1.5	Sun Aug 24 13:03:39 2008
+++ src/sys/arch/sgimips/hpc/haltwovar.h	Thu Sep 24 14:09:18 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: haltwovar.h,v 1.5 2008/08/24 13:03:39 tsutsui Exp $ */
+/* $NetBSD: haltwovar.h,v 1.6 2009/09/24 14:09:18 tsutsui Exp $ */
 
 /*
  * Copyright (c) 2003 Ilpo Ruotsalainen
@@ -81,8 +81,6 @@
 	bus_space_handle_t sc_aes_sh;
 	bus_space_handle_t sc_vol_sh;
 	bus_space_handle_t sc_syn_sh;
-
-	void *sc_sdhook;
 };
 
 #endif

Reply via email to