Call bus_generic_detach on pcic before deleting the children. This

has the side effect of detaching the children before I delete them.
When I put the last commits in a loop for loop it died after 5 or so
iterations.  After this change, I lasted 50 before I stopped the test.
This commit is contained in:
imp 2000-08-19 05:01:07 +00:00
parent 5fcbd3fb14
commit 1bdb3f5261

View File

@ -1523,6 +1523,9 @@ pcic_detach(device_t dev)
int i;
int ret;
ret = bus_generic_detach(dev);
if (ret != 0)
return (ret);
device_get_children(dev, &kids, &nkids);
for (i = 0; i < nkids; i++) {
if ((ret = device_delete_child(pccarddev, kids[i])) != 0)
@ -1530,7 +1533,7 @@ pcic_detach(device_t dev)
device_get_nameunit(kids[i]), ret);
}
free(kids, M_TEMP);
return (bus_generic_detach(dev));
return 0;
}
SYSINIT(pcic, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, pcic_start_threads, 0);