diff options
author | jake <jake@FreeBSD.org> | 2003-01-27 18:39:09 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2003-01-27 18:39:09 +0000 |
commit | 653f23c4bf45c0cff0bc9bee7010483ce2a4968e (patch) | |
tree | 73075abb23adf46acceef61de97f216305d5ae95 | |
parent | 015f9bceccea3107a2d5801b7a4c68f088258378 (diff) | |
download | FreeBSD-src-653f23c4bf45c0cff0bc9bee7010483ce2a4968e.zip FreeBSD-src-653f23c4bf45c0cff0bc9bee7010483ce2a4968e.tar.gz |
Add the sabtty children devices as unordered. Use the unit numbr of
the sabtty device to create its description so that they will be
unique for machines with multiple sab chips.
This fixes a panic on machines with an rsc card.
Tested by: obrien (e250)
-rw-r--r-- | sys/dev/sab/sab.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/sab/sab.c b/sys/dev/sab/sab.c index 2daf97b..0540dcf 100644 --- a/sys/dev/sab/sab.c +++ b/sys/dev/sab/sab.c @@ -332,7 +332,7 @@ sab_attach(device_t dev) SAB_WRITE(sc, SAB_IPC, sc->sc_ipc); for (i = 0; i < SAB_NCHAN; i++) - child[i] = device_add_child(dev, "sabtty", i); + child[i] = device_add_child(dev, "sabtty", -1); bus_generic_attach(dev); for (i = 0; i < SAB_NCHAN; i++) sc->sc_child[i] = device_get_softc(child[i]); @@ -413,11 +413,10 @@ sab_shutdown(void *v) static int sabtty_probe(device_t dev) { + char desc[32]; - if ((device_get_unit(dev) & 1) == 0) - device_set_desc(dev, "ttya"); - else - device_set_desc(dev, "ttyb"); + snprintf(desc, sizeof(desc), "tty%c", device_get_unit(dev) + 'a'); + device_set_desc_copy(dev, desc); return (0); } |