diff options
Diffstat (limited to 'sys/dev/pcic')
-rw-r--r-- | sys/dev/pcic/i82365.c | 8 |
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) |