mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fix the detach code to actually detach the disk instance created
during attach.
This commit is contained in:
parent
6ccf52c822
commit
7d0bbeb87c
1 changed files with 1 additions and 5 deletions
|
|
@ -83,7 +83,6 @@ static struct cdevsw id_cdevsw = {
|
|||
|
||||
static devclass_t idad_devclass;
|
||||
static struct cdevsw idaddisk_cdevsw;
|
||||
static int disks_registered = 0;
|
||||
|
||||
static device_method_t idad_methods[] = {
|
||||
DEVMETHOD(device_probe, idad_probe),
|
||||
|
|
@ -269,7 +268,6 @@ idad_attach(device_t dev)
|
|||
|
||||
dsk->si_drv1 = drv;
|
||||
dsk->si_iosize_max = DFLTPHYS; /* XXX guess? */
|
||||
disks_registered++;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
|
@ -281,8 +279,6 @@ idad_detach(device_t dev)
|
|||
|
||||
drv = (struct idad_softc *)device_get_softc(dev);
|
||||
devstat_remove_entry(&drv->stats);
|
||||
|
||||
if (--disks_registered == 0)
|
||||
cdevsw_remove(&idaddisk_cdevsw);
|
||||
disk_destroy(&drv->disk);
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue