diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-21 12:18:50 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-21 12:18:50 +0000 |
commit | 4beeeb807c32f82be0cbea3575a39a581c703b00 (patch) | |
tree | 8710bab9d5a179ff6e2bbd4d70ee28c03ff08552 /sys/dev/ata/wd.c | |
parent | 5753cb9ef99c0f2c418a4a77f544a1ab2c879e2f (diff) |
Invoke disk_detach() and related cleanup work in detach(), rather than
zeroref() - just to be on the safe side, should we mess up our ref count.
Diffstat (limited to 'sys/dev/ata/wd.c')
-rw-r--r-- | sys/dev/ata/wd.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c index 89fb2089b52..640cb8f727b 100644 --- a/sys/dev/ata/wd.c +++ b/sys/dev/ata/wd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wd.c,v 1.45 2005/11/09 19:05:48 uwe Exp $ */ +/* $OpenBSD: wd.c,v 1.46 2006/01/21 12:18:47 miod Exp $ */ /* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */ /* @@ -182,12 +182,11 @@ int wdprobe(struct device *, void *, void *); void wdattach(struct device *, struct device *, void *); int wddetach(struct device *, int); int wdactivate(struct device *, enum devact); -void wdzeroref(struct device *); int wdprint(void *, char *); struct cfattach wd_ca = { sizeof(struct wd_softc), wdprobe, wdattach, - wddetach, wdactivate, wdzeroref + wddetach, wdactivate }; #ifdef __OpenBSD__ @@ -445,6 +444,9 @@ wddetach(struct device *self, int flags) if (sc->sc_sdhook != NULL) shutdownhook_disestablish(sc->sc_sdhook); + /* Detach disk. */ + disk_detach(&sc->sc_dk); + #if NRND > 0 /* Unhook the entropy source. */ rnd_detach_source(&sc->rnd_source); @@ -453,15 +455,6 @@ wddetach(struct device *self, int flags) return (0); } -void -wdzeroref(struct device *self) -{ - struct wd_softc *sc = (struct wd_softc *)self; - - /* Detach disk. */ - disk_detach(&sc->sc_dk); -} - /* * Read/write routine for a buffer. Validates the arguments and schedules the * transfer. Does not wait for the transfer to complete. |