diff options
author | imp <imp@FreeBSD.org> | 2004-11-21 16:25:21 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2004-11-21 16:25:21 +0000 |
commit | 362677f869c625a0d2f034ec6c0fd1d8ae2a9e7a (patch) | |
tree | 8f2a30e404754fb5d15f37364ebfb4a91af4532a /sys/dev/fdc | |
parent | 8ce0911a9f76f3436aa9ae16d30d06bbacbd3032 (diff) | |
download | FreeBSD-src-362677f869c625a0d2f034ec6c0fd1d8ae2a9e7a.zip FreeBSD-src-362677f869c625a0d2f034ec6c0fd1d8ae2a9e7a.tar.gz |
Properly wither the geom container on detach. This will allow one to
then later reload fdc and not have duplicate fd devices in dev.
# Maybe this should be moved to a convenience function.
Reviewed by: phk
Diffstat (limited to 'sys/dev/fdc')
-rw-r--r-- | sys/dev/fdc/fdc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index a2193f0..5846b0a 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -1957,6 +1957,11 @@ fd_detach(device_t dev) struct fd_data *fd; fd = device_get_softc(dev); + g_topology_lock(); + g_wither_geom(fd->fd_geom, ENXIO); + g_topology_unlock(); + while (device_get_state(dev) == DS_BUSY) + tsleep(fd, PZERO, "fdd", hz/10); callout_drain(&fd->toffhandle); return (0); |