summaryrefslogtreecommitdiffstats
path: root/sys/dev/pcic
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2000-08-30 06:56:03 +0000
committerimp <imp@FreeBSD.org>2000-08-30 06:56:03 +0000
commit00a3fcaf80f1bb99b84ba3ee2e9fd59488c71761 (patch)
treee50ba731139f2540fdd9bef7051d4da4915ebae2 /sys/dev/pcic
parent11adb5ee6788402b4f2aa3ebdb613a9ca552a12a (diff)
downloadFreeBSD-src-00a3fcaf80f1bb99b84ba3ee2e9fd59488c71761.zip
FreeBSD-src-00a3fcaf80f1bb99b84ba3ee2e9fd59488c71761.tar.gz
Add comment about why the deletion of children is necessary in detach.
Diffstat (limited to 'sys/dev/pcic')
-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 3e7b58a..dd36c3a 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)
OpenPOWER on IntegriCloud