aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2000-08-30 06:56:03 +0000
committerWarner Losh <imp@FreeBSD.org>2000-08-30 06:56:03 +0000
commitf5c4d53efc98baa07554c96fed6a0ebab566c762 (patch)
treeb72ae38f1906339a2162d7c375cd0c594119bc79 /sys
parent642880263811176341c8b40695fe0dfc6f620a94 (diff)
downloadsrc-f5c4d53efc98baa07554c96fed6a0ebab566c762.tar.gz
src-f5c4d53efc98baa07554c96fed6a0ebab566c762.zip
Add comment about why the deletion of children is necessary in detach.
Notes
Notes: svn path=/head/; revision=65241
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pcic/i82365.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/pcic/i82365.c b/sys/dev/pcic/i82365.c
index 3e7b58a4b354..dd36c3ac176a 100644
--- a/sys/dev/pcic/i82365.c
+++ b/sys/dev/pcic/i82365.c
@@ -1524,6 +1524,14 @@ pcic_detach(device_t dev)
ret = bus_generic_detach(dev);
if (ret != 0)
return (ret);
+ /*
+ * Normally, one wouldn't delete the children. However, detach
+ * merely detaches the children w/o deleting them. So if
+ * we were to reattach, we add additional children and wind up
+ * with duplicates. So, we remove them here following the
+ * implicit "if you add it in attach, you should delete it in
+ * detach" rule that may or may not be documented.
+ */
device_get_children(dev, &kids, &nkids);
for (i = 0; i < nkids; i++) {
if ((ret = device_delete_child(dev, kids[i])) != 0)