FreeBSD/sys/dev/spibus/spibus.c
/*
 * Since this is not a self-enumerating bus, and since we always add
 * children in attach, we have to always delete children here.
 */
Since this is not a self-enumerating bus, and since we always add
children in attach, we have to always delete children here.
Since this is not a self - enumerating bus and since we always add children in attach we have to always delete children here .
static int
spibus_detach(device_t dev)
{
	int err, ndevs, i;
	device_t *devlist;
	if ((err = bus_generic_detach(dev)) != 0)
		return (err);
	if ((err = device_get_children(dev, &devlist, &ndevs)) != 0)
		return (err);
	for (i = 0; i < ndevs; i++)
		device_delete_child(dev, devlist[i]);
	free(devlist, M_TEMP);
	return (0);
}
static int spibus_detach ( device_t dev ) { int err , ndevs , i ; device_t * devlist ; if ( ( err = bus_generic_detach ( dev ) ) != 0 ) return ( err ) ; if ( ( err = device_get_children ( dev , & devlist , & ndevs ) ) != 0 ) return ( err ) ; for ( i = 0 ; i < ndevs ; i ++ ) device_delete_child ( dev , devlist [ i ] ) ; free ( devlist , M_TEMP ) ; return ( 0 ) ; }
Since this is not a self-enumerating bus, and since we always add
 children in attach, we have to always delete children here.
Since this is not a self - enumerating bus and since we always add children in attach we have to always delete children here .