Module Name: src
Committed By: bjh21
Date: Mon May 11 20:13:50 UTC 2009
Modified Files:
src/sys/dev/podulebus: sec.c
Log Message:
Replace shutdownhooks with pmf in sec(4).
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/podulebus/sec.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/podulebus/sec.c
diff -u src/sys/dev/podulebus/sec.c:1.14 src/sys/dev/podulebus/sec.c:1.15
--- src/sys/dev/podulebus/sec.c:1.14 Thu Feb 12 06:24:45 2009
+++ src/sys/dev/podulebus/sec.c Mon May 11 20:13:49 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: sec.c,v 1.14 2009/02/12 06:24:45 rumble Exp $ */
+/* $NetBSD: sec.c,v 1.15 2009/05/11 20:13:49 bjh21 Exp $ */
/*-
* Copyright (c) 2000, 2001, 2006 Ben Harris
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sec.c,v 1.14 2009/02/12 06:24:45 rumble Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sec.c,v 1.15 2009/05/11 20:13:49 bjh21 Exp $");
#include <sys/param.h>
@@ -95,7 +95,7 @@
static void sec_attach(device_t, device_t, void *);
/* shutdown hook */
-static void sec_shutdown(void *);
+static bool sec_shutdown(device_t, int);
/* callbacks from MI WD33C93 driver */
static int sec_dmasetup(struct wd33c93_softc *, void **, size_t *, int,
@@ -214,19 +214,20 @@
sec_cli(sc);
sc->sc_mpr |= SEC_MPR_IE;
bus_space_write_1(sc->sc_pod_t, sc->sc_pod_h, SEC_MPR, sc->sc_mpr);
- shutdownhook_establish(sec_shutdown, sc);
+ pmf_device_register1(sc->sc_sbic.sc_dev, NULL, NULL, sec_shutdown);
}
/*
* Before reboot, reset the page register to 0 so that RISC OS can see
* the podule ROM.
*/
-static void
-sec_shutdown(void *cookie)
+static bool
+sec_shutdown(device_t dev, int howto)
{
- struct sec_softc *sc = cookie;
+ struct sec_softc *sc = device_private(dev);
sec_setpage(sc, 0);
+ return true;
}
static void