summaryrefslogtreecommitdiffstats
path: root/sys/isa/sio.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-08-27 14:46:13 +0000
committerphk <phk@FreeBSD.org>2000-08-27 14:46:13 +0000
commit7173fac52902acf879b833b7ade03cd2c55aa45a (patch)
treef415a2a712f7d2422c8f1443201fc51d015dc0b7 /sys/isa/sio.c
parentf317a3f7e1a71a32caef15bb01a0e5253f4bf727 (diff)
downloadFreeBSD-src-7173fac52902acf879b833b7ade03cd2c55aa45a.zip
FreeBSD-src-7173fac52902acf879b833b7ade03cd2c55aa45a.tar.gz
Call destroy_dev() when sio devices go away.
Diffstat (limited to 'sys/isa/sio.c')
-rw-r--r--sys/isa/sio.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/isa/sio.c b/sys/isa/sio.c
index 73af0fe..828a899 100644
--- a/sys/isa/sio.c
+++ b/sys/isa/sio.c
@@ -279,6 +279,7 @@ struct com_s {
struct resource *irqres;
struct resource *ioportres;
void *cookie;
+ dev_t devs[6];
/*
* Data area for output buffers. Someday we should build the output
@@ -544,6 +545,7 @@ sio_pccard_detach(dev)
device_t dev;
{
struct com_s *com;
+ int i;
com = (struct com_s *) device_get_softc(dev);
if (com == NULL) {
@@ -551,6 +553,8 @@ sio_pccard_detach(dev)
return (0);
}
com->gone = 1;
+ for (i = 0 ; i < 6; i++)
+ destroy_dev(com->devs[i]);
if (com->irqres) {
bus_teardown_intr(dev, com->irqres, com->cookie);
bus_release_resource(dev, SYS_RES_IRQ, 0, com->irqres);
@@ -1311,17 +1315,19 @@ determined_type: ;
register_swi(SWI_TTY, siopoll);
sio_registered = TRUE;
}
- make_dev(&sio_cdevsw, unit,
+ com->devs[0] = make_dev(&sio_cdevsw, unit,
UID_ROOT, GID_WHEEL, 0600, "ttyd%r", unit);
- make_dev(&sio_cdevsw, unit | CONTROL_INIT_STATE,
+ com->devs[1] = make_dev(&sio_cdevsw, unit | CONTROL_INIT_STATE,
UID_ROOT, GID_WHEEL, 0600, "ttyid%r", unit);
- make_dev(&sio_cdevsw, unit | CONTROL_LOCK_STATE,
+ com->devs[2] = make_dev(&sio_cdevsw, unit | CONTROL_LOCK_STATE,
UID_ROOT, GID_WHEEL, 0600, "ttyld%r", unit);
- make_dev(&sio_cdevsw, unit | CALLOUT_MASK,
+ com->devs[3] = make_dev(&sio_cdevsw, unit | CALLOUT_MASK,
UID_UUCP, GID_DIALER, 0660, "cuaa%r", unit);
- make_dev(&sio_cdevsw, unit | CALLOUT_MASK | CONTROL_INIT_STATE,
+ com->devs[4] = make_dev(&sio_cdevsw,
+ unit | CALLOUT_MASK | CONTROL_INIT_STATE,
UID_UUCP, GID_DIALER, 0660, "cuaia%r", unit);
- make_dev(&sio_cdevsw, unit | CALLOUT_MASK | CONTROL_LOCK_STATE,
+ com->devs[5] = make_dev(&sio_cdevsw,
+ unit | CALLOUT_MASK | CONTROL_LOCK_STATE,
UID_UUCP, GID_DIALER, 0660, "cuala%r", unit);
com->flags = flags;
com->pps.ppscap = PPS_CAPTUREASSERT | PPS_CAPTURECLEAR;
OpenPOWER on IntegriCloud