summaryrefslogtreecommitdiffstats
path: root/sys/dev/ppbus/lpbb.c
diff options
context:
space:
mode:
authorguido <guido@FreeBSD.org>2004-03-18 21:10:11 +0000
committerguido <guido@FreeBSD.org>2004-03-18 21:10:11 +0000
commitdf746a8c4241af79c5cde3a41a26daaefdf64556 (patch)
tree1803a74593eaa121eb1d3af15ebcdea5d85f572b /sys/dev/ppbus/lpbb.c
parent569c6a8eda957ba93206aab029082de086eb77f4 (diff)
downloadFreeBSD-src-df746a8c4241af79c5cde3a41a26daaefdf64556.zip
FreeBSD-src-df746a8c4241af79c5cde3a41a26daaefdf64556.tar.gz
Prevent the strange situation that after each load/unload of a ppbus
device, the device is probed multiple times (so each device is detected N times after unloading/loading the module N-1 times). The real fix is (quote Doug and Warner): > : In an ideal world, there should be some kind of BUS_UNIDENTIFY method > : which a driver could use to delete the devices it created in > : BUS_IDENTIFY. > > Or the bus would have a driver deleted routine that got called and it > would remove all instances of the devclass attached to it. Reviewed by: Doug Rabson & Warner Losh
Diffstat (limited to 'sys/dev/ppbus/lpbb.c')
-rw-r--r--sys/dev/ppbus/lpbb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/ppbus/lpbb.c b/sys/dev/ppbus/lpbb.c
index 6516f50..a9b3667 100644
--- a/sys/dev/ppbus/lpbb.c
+++ b/sys/dev/ppbus/lpbb.c
@@ -58,7 +58,11 @@ static void
lpbb_identify(driver_t *driver, device_t parent)
{
- BUS_ADD_CHILD(parent, 0, "lpbb", -1);
+ device_t dev;
+
+ dev = device_find_child(parent, "lpbb", 0);
+ if (!dev)
+ BUS_ADD_CHILD(parent, 0, "lpbb", -1);
}
static int
OpenPOWER on IntegriCloud