Module Name: src
Committed By: tsutsui
Date: Sat Sep 26 16:03:45 UTC 2009
Modified Files:
src/sys/arch/sun3/dev: fd.c
Log Message:
Replace shutdownhook_establish(9) with pmf_device_register1(9).
Tested on 3/80.
To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/sun3/dev/fd.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/arch/sun3/dev/fd.c
diff -u src/sys/arch/sun3/dev/fd.c:1.69 src/sys/arch/sun3/dev/fd.c:1.70
--- src/sys/arch/sun3/dev/fd.c:1.69 Tue Jan 13 13:35:52 2009
+++ src/sys/arch/sun3/dev/fd.c Sat Sep 26 16:03:45 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: fd.c,v 1.69 2009/01/13 13:35:52 yamt Exp $ */
+/* $NetBSD: fd.c,v 1.70 2009/09/26 16:03:45 tsutsui Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.69 2009/01/13 13:35:52 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.70 2009/09/26 16:03:45 tsutsui Exp $");
#include "opt_ddb.h"
@@ -258,8 +258,6 @@
int sc_cylin; /* where we think the head is */
int sc_opts; /* user-set options */
- void *sc_sdhook; /* shutdownhook cookie */
-
TAILQ_ENTRY(fd_softc) sc_drivechain;
int sc_ops; /* I/O ops since last switch */
struct bufq_state *sc_q;/* pending I/O requests */
@@ -289,6 +287,7 @@
nostop, notty, nopoll, nommap, nokqfilter, D_DISK
};
+static bool fd_shutdown(device_t, int);
void fdgetdisklabel(dev_t);
int fd_get_parms(struct fd_softc *);
void fdstart(struct fd_softc *);
@@ -613,7 +612,19 @@
mountroothook_establish(fd_mountroot_hook, self);
/* Make sure the drive motor gets turned off at shutdown time. */
- fd->sc_sdhook = shutdownhook_establish(fd_motor_off, fd);
+ if (!pmf_device_register1(self, NULL, NULL, fd_shutdown))
+ aprint_error_dev(self, "couldn't establish power handler\n");
+}
+
+bool
+fd_shutdown(device_t self, int howto)
+{
+ struct fd_softc *fd;
+
+ fd = device_private(self);
+ fd_motor_off(fd);
+
+ return true;
}
inline struct fd_type *