From a68a96aad7ad6d715e4f7f747925fca226e076bd Mon Sep 17 00:00:00 2001 From: Jake Burkholder Date: Mon, 27 Jan 2003 18:39:09 +0000 Subject: [PATCH] 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) --- sys/dev/sab/sab.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/dev/sab/sab.c b/sys/dev/sab/sab.c index 2daf97b8b15..0540dcfcc4f 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); }