summaryrefslogtreecommitdiff
path: root/sys/dev/isa
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-05-30 16:15:03 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-05-30 16:15:03 +0000
commit0a2136fff807fb71339f3d499b31f09ef14bf891 (patch)
tree8996416e2647c8beebebaa3a97c2205aed0adce3 /sys/dev/isa
parent52c68f7659b12bec7c8ef0539aca056f2550327b (diff)
Enforce ca_activate tree-walks over the entire heirarchy for all events,
cleaning up some shutdown-hook related code on the way. (A few drivers related to sparc are still skipped at kettenis' request) ok kettenis mlarkin, tested by many others too
Diffstat (limited to 'sys/dev/isa')
-rw-r--r--sys/dev/isa/fd.c24
-rw-r--r--sys/dev/isa/isa.c5
2 files changed, 19 insertions, 10 deletions
diff --git a/sys/dev/isa/fd.c b/sys/dev/isa/fd.c
index 0d02c79a1f4..f7e8830537c 100644
--- a/sys/dev/isa/fd.c
+++ b/sys/dev/isa/fd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fd.c,v 1.92 2011/07/04 05:41:48 matthew Exp $ */
+/* $OpenBSD: fd.c,v 1.93 2013/05/30 16:15:02 deraadt Exp $ */
/* $NetBSD: fd.c,v 1.90 1996/05/12 23:12:03 mycroft Exp $ */
/*-
@@ -117,8 +117,6 @@ struct fd_softc {
#define FD_MOTOR_WAIT 0x04 /* motor coming up */
int sc_cylin; /* where we think the head is */
- void *sc_sdhook; /* saved shutdown hook for drive. */
-
TAILQ_ENTRY(fd_softc) sc_drivechain;
int sc_ops; /* I/O ops since last switch */
struct buf sc_q; /* head of buf chain */
@@ -130,9 +128,10 @@ struct fd_softc {
/* floppy driver configuration */
int fdprobe(struct device *, void *, void *);
void fdattach(struct device *, struct device *, void *);
+int fdactivate(struct device *, int);
struct cfattach fd_ca = {
- sizeof(struct fd_softc), fdprobe, fdattach
+ sizeof(struct fd_softc), fdprobe, fdattach, NULL, fdactivate
};
struct cfdriver fd_cd = {
@@ -302,15 +301,26 @@ fdattach(struct device *parent, struct device *self, void *aux)
fd->sc_dk.dk_name = fd->sc_dev.dv_xname;
disk_attach(&fd->sc_dev, &fd->sc_dk);
- /* Needed to power off if the motor is on when we halt. */
- fd->sc_sdhook = shutdownhook_establish(fd_motor_off, fd);
-
/* Setup timeout structures */
timeout_set(&fd->fd_motor_on_to, fd_motor_on, fd);
timeout_set(&fd->fd_motor_off_to, fd_motor_off, fd);
timeout_set(&fd->fdtimeout_to, fdtimeout, fd);
}
+int
+fdactivate(struct device *self, int act)
+{
+ int rv = 0;
+
+ switch (act) {
+ case DVACT_POWERDOWN:
+ fd_motor_off(self);
+ break;
+ }
+
+ return (rv);
+}
+
/*
* Translate nvram type into internal data structure. Return NULL for
* none/unknown/unusable.
diff --git a/sys/dev/isa/isa.c b/sys/dev/isa/isa.c
index 408e9f179dd..f817620e328 100644
--- a/sys/dev/isa/isa.c
+++ b/sys/dev/isa/isa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isa.c,v 1.40 2010/07/08 20:18:32 deraadt Exp $ */
+/* $OpenBSD: isa.c,v 1.41 2013/05/30 16:15:02 deraadt Exp $ */
/* $NetBSD: isa.c,v 1.85 1996/05/14 00:31:04 thorpej Exp $ */
/*
@@ -75,8 +75,7 @@ void isaattach(struct device *, struct device *, void *);
extern int autoconf_verbose;
struct cfattach isa_ca = {
- sizeof(struct isa_softc), isamatch, isaattach, NULL,
- config_activate_children
+ sizeof(struct isa_softc), isamatch, isaattach
};
struct cfdriver isa_cd = {