summaryrefslogtreecommitdiff
path: root/sys/scsi/cd.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-01-21 12:18:50 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-01-21 12:18:50 +0000
commit4beeeb807c32f82be0cbea3575a39a581c703b00 (patch)
tree8710bab9d5a179ff6e2bbd4d70ee28c03ff08552 /sys/scsi/cd.c
parent5753cb9ef99c0f2c418a4a77f544a1ab2c879e2f (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/scsi/cd.c')
-rw-r--r--sys/scsi/cd.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index d31e6f80c65..750429f9418 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.103 2006/01/17 20:22:22 miod Exp $ */
+/* $OpenBSD: cd.c,v 1.104 2006/01/21 12:18:49 miod Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -100,7 +100,6 @@ int cdmatch(struct device *, void *, void *);
void cdattach(struct device *, struct device *, void *);
int cdactivate(struct device *, enum devact);
int cddetach(struct device *, int);
-void cdzeroref(struct device *);
void cdstart(void *);
void cdminphys(struct buf *);
@@ -136,7 +135,7 @@ int dvd_read_struct(struct cd_softc *, union dvd_struct *);
struct cfattach cd_ca = {
sizeof(struct cd_softc), cdmatch, cdattach,
- cddetach, cdactivate, cdzeroref
+ cddetach, cdactivate
};
struct cfdriver cd_cd = {
@@ -277,19 +276,12 @@ cddetach(self, flags)
for (cmaj = 0; cmaj < nchrdev; cmaj++)
if (cdevsw[cmaj].d_open == cdopen)
vdevgone(cmaj, mn, mn + MAXPARTITIONS - 1, VCHR);
- return (0);
-}
-
-void
-cdzeroref(self)
- struct device *self;
-{
- struct cd_softc *cd = (struct cd_softc *)self;
/* Detach disk. */
- disk_detach(&cd->sc_dk);
-}
+ disk_detach(&sc->sc_dk);
+ return (0);
+}
/*
* Open the device. Make sure the partition info is as up-to-date as can be.