diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-05-30 16:15:03 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-05-30 16:15:03 +0000 |
commit | 0a2136fff807fb71339f3d499b31f09ef14bf891 (patch) | |
tree | 8996416e2647c8beebebaa3a97c2205aed0adce3 /sys/arch/sparc/dev | |
parent | 52c68f7659b12bec7c8ef0539aca056f2550327b (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/arch/sparc/dev')
-rw-r--r-- | sys/arch/sparc/dev/fd.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c index d9e4d7b70e9..717631268a7 100644 --- a/sys/arch/sparc/dev/fd.c +++ b/sys/arch/sparc/dev/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.82 2013/01/01 01:00:14 miod Exp $ */ +/* $OpenBSD: fd.c,v 1.83 2013/05/30 16:15:01 deraadt Exp $ */ /* $NetBSD: fd.c,v 1.51 1997/05/24 20:16:19 pk Exp $ */ /*- @@ -215,8 +215,6 @@ struct fd_softc { 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 buf sc_q; /* head of buf chain */ @@ -228,9 +226,11 @@ struct fd_softc { /* floppy driver configuration */ int fdmatch(struct device *, void *, void *); void fdattach(struct device *, struct device *, void *); +int fdactivate(struct device *, int); struct cfattach fd_ca = { - sizeof(struct fd_softc), fdmatch, fdattach + sizeof(struct fd_softc), fdmatch, fdattach, + NULL, fdactivate }; struct cfdriver fd_cd = { @@ -649,9 +649,22 @@ fdattach(parent, self, aux) */ if (fa->fa_bootpath) fa->fa_bootpath->dev = &fd->sc_dv; +} + +int +fdactivate(struct device *self, int act) +{ + struct fd_softc *sc = (struct fd_softc *)self; + int ret = 0; + + switch (act) { + case DVACT_POWERDOWN: + /* Make sure the drive motor gets turned off at shutdown time. */ + fd_motor_off(sc); + break; + } - /* Make sure the drive motor gets turned off at shutdown time. */ - fd->sc_sdhook = shutdownhook_establish(fd_motor_off, fd); + return (ret); } __inline struct fd_type * |