summaryrefslogtreecommitdiffstats
path: root/sys/dev/smbus/smb.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-12-20 14:26:47 +0000
committerru <ru@FreeBSD.org>2005-12-20 14:26:47 +0000
commitc062801e068f9684bdff72d4789f78f61f46e395 (patch)
tree15729f4adda4bf8dd316692f3ce6bc511287b5e2 /sys/dev/smbus/smb.c
parent7245d518e8613a91f727a587f0d552cafff8e692 (diff)
downloadFreeBSD-src-c062801e068f9684bdff72d4789f78f61f46e395.zip
FreeBSD-src-c062801e068f9684bdff72d4789f78f61f46e395.tar.gz
Stop creating duplicate "smb" devices when unloading/loading smb.ko,
using the protection mechanisms described in device_add_child(9).
Diffstat (limited to 'sys/dev/smbus/smb.c')
-rw-r--r--sys/dev/smbus/smb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/smbus/smb.c b/sys/dev/smbus/smb.c
index 4c1c5b1..8073cc5 100644
--- a/sys/dev/smbus/smb.c
+++ b/sys/dev/smbus/smb.c
@@ -97,7 +97,9 @@ static struct cdevsw smb_cdevsw = {
static void
smb_identify(driver_t *driver, device_t parent)
{
- BUS_ADD_CHILD(parent, 0, "smb", -1);
+
+ if (!device_find_child(parent, "smb", -1))
+ device_add_child(parent, "smb", -1);
}
static int
OpenPOWER on IntegriCloud