diff options
author | jmg <jmg@FreeBSD.org> | 2004-06-13 05:00:19 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 2004-06-13 05:00:19 +0000 |
commit | 0e5fdfdf5d24dc2e6902bd9e333e2395beaf9a05 (patch) | |
tree | 9963787818f0b498d72b257050d4b2406ffafa87 | |
parent | 91c65a303c6b09b4286d73414724d52f6fde1973 (diff) | |
download | FreeBSD-src-0e5fdfdf5d24dc2e6902bd9e333e2395beaf9a05.zip FreeBSD-src-0e5fdfdf5d24dc2e6902bd9e333e2395beaf9a05.tar.gz |
make code less broken, only try to create unit 0 since there can only
be one, this will help prevent multipling devices if this driver is
ever loaded/unloaded multiple times...
Prodded by: julian
-rw-r--r-- | sys/dev/ichwd/ichwd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ichwd/ichwd.c b/sys/dev/ichwd/ichwd.c index d97397d..73f8719 100644 --- a/sys/dev/ichwd/ichwd.c +++ b/sys/dev/ichwd/ichwd.c @@ -247,8 +247,10 @@ ichwd_identify(driver_t *driver, device_t parent) /* good, add child to bus */ if ((dev = device_find_child(parent, driver->name, 0)) == NULL) - dev = BUS_ADD_CHILD(parent, 0, driver->name, -1); - device_set_desc_copy(dev, id->desc); + dev = BUS_ADD_CHILD(parent, 0, driver->name, 0); + + if (dev != NULL) + device_set_desc_copy(dev, id->desc); } static int |