summaryrefslogtreecommitdiffstats
path: root/sys/dev/twe
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-02-22 10:42:21 +0000
committerphk <phk@FreeBSD.org>2003-02-22 10:42:21 +0000
commit2b4c2f758e2250788d22cdfe173a12838ca71391 (patch)
tree7531880b82246a07a047c28f891fda802e0ccc0d /sys/dev/twe
parentaf0665da78bf5be5cd3622788e00583c2c974dba (diff)
downloadFreeBSD-src-2b4c2f758e2250788d22cdfe173a12838ca71391.zip
FreeBSD-src-2b4c2f758e2250788d22cdfe173a12838ca71391.tar.gz
Use DISKFLAG_OPEN rather than maintaining our own flag.
Use nullclose() rather than now empty twed_close().
Diffstat (limited to 'sys/dev/twe')
-rw-r--r--sys/dev/twe/twe_freebsd.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/sys/dev/twe/twe_freebsd.c b/sys/dev/twe/twe_freebsd.c
index 9bc27a3..cc6efca 100644
--- a/sys/dev/twe/twe_freebsd.c
+++ b/sys/dev/twe/twe_freebsd.c
@@ -549,8 +549,6 @@ struct twed_softc
struct twe_drive *twed_drive; /* drive data in parent softc */
struct disk twed_disk; /* generic disk handle */
struct devstat twed_stats; /* accounting */
- int twed_flags;
-#define TWED_OPEN (1<<0) /* drive is open (can't shut down) */
};
/*
@@ -584,7 +582,6 @@ DRIVER_MODULE(twed, twe, twed_driver, twed_devclass, 0, 0);
* Disk device control interface.
*/
static d_open_t twed_open;
-static d_close_t twed_close;
static d_strategy_t twed_strategy;
static dumper_t twed_dump;
@@ -592,7 +589,7 @@ static dumper_t twed_dump;
static struct cdevsw twed_cdevsw = {
twed_open,
- twed_close,
+ nullclose,
physread,
physwrite,
noioctl,
@@ -636,24 +633,6 @@ twed_open(dev_t dev, int flags, int fmt, d_thread_t *td)
sc->twed_disk.d_fwsectors = sc->twed_drive->td_sectors;
sc->twed_disk.d_fwheads = sc->twed_drive->td_heads;
- sc->twed_flags |= TWED_OPEN;
- return (0);
-}
-
-/********************************************************************************
- * Handle last close of the disk device.
- */
-static int
-twed_close(dev_t dev, int flags, int fmt, d_thread_t *td)
-{
- struct twed_softc *sc = (struct twed_softc *)dev->si_drv1;
-
- debug_called(4);
-
- if (sc == NULL)
- return (ENXIO);
-
- sc->twed_flags &= ~TWED_OPEN;
return (0);
}
@@ -793,7 +772,7 @@ twed_detach(device_t dev)
debug_called(4);
- if (sc->twed_flags & TWED_OPEN)
+ if (sc->twed_disk.d_flags & DISKFLAG_OPEN)
return(EBUSY);
devstat_remove_entry(&sc->twed_stats);
OpenPOWER on IntegriCloud