diff options
author | guido <guido@FreeBSD.org> | 2004-03-18 21:10:11 +0000 |
---|---|---|
committer | guido <guido@FreeBSD.org> | 2004-03-18 21:10:11 +0000 |
commit | df746a8c4241af79c5cde3a41a26daaefdf64556 (patch) | |
tree | 1803a74593eaa121eb1d3af15ebcdea5d85f572b /sys/dev/ppbus/lpt.c | |
parent | 569c6a8eda957ba93206aab029082de086eb77f4 (diff) | |
download | FreeBSD-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/lpt.c')
-rw-r--r-- | sys/dev/ppbus/lpt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c index f0bdea7..7855e36 100644 --- a/sys/dev/ppbus/lpt.c +++ b/sys/dev/ppbus/lpt.c @@ -340,7 +340,11 @@ static void lpt_identify(driver_t *driver, device_t parent) { - BUS_ADD_CHILD(parent, 0, LPT_NAME, -1); + device_t dev; + + dev = device_find_child(parent, LPT_NAME, 0); + if (!dev) + BUS_ADD_CHILD(parent, 0, LPT_NAME, -1); } /* |