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/if_plip.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/if_plip.c')
-rw-r--r-- | sys/dev/ppbus/if_plip.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/ppbus/if_plip.c b/sys/dev/ppbus/if_plip.c index 32221c7..9805e0b 100644 --- a/sys/dev/ppbus/if_plip.c +++ b/sys/dev/ppbus/if_plip.c @@ -183,8 +183,11 @@ static devclass_t lp_devclass; static void lp_identify(driver_t *driver, device_t parent) { + device_t dev; - BUS_ADD_CHILD(parent, 0, "plip", -1); + dev = device_find_child(parent, "plip", 0); + if (!dev) + BUS_ADD_CHILD(parent, 0, "plip", -1); } /* * lpprobe() |