From 362677f869c625a0d2f034ec6c0fd1d8ae2a9e7a Mon Sep 17 00:00:00 2001 From: imp Date: Sun, 21 Nov 2004 16:25:21 +0000 Subject: [PATCH] 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 --- sys/dev/fdc/fdc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index a2193f048d6..5846b0aa446 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); -- 2.45.2