FreeBSD/sys/kern/subr_bus.c
/**
 * @brief Decrement the busy counter for the device
 */
@brief Decrement the busy counter for the device
@brief Decrement the busy counter for the device
void
device_unbusy(device_t dev)
{
	if (dev->busy != 0 && dev->state != DS_BUSY &&
	    dev->state != DS_ATTACHING)
		panic("device_unbusy: called for non-busy device %s",
		    device_get_nameunit(dev));
	dev->busy--;
	if (dev->busy == 0) {
		if (dev->parent)
			device_unbusy(dev->parent);
		if (dev->state == DS_BUSY)
			dev->state = DS_ATTACHED;
	}
}
void device_unbusy ( device_t dev ) { if ( dev -> busy != 0 && dev -> state != DS_BUSY && dev -> state != DS_ATTACHING ) panic ( " " , device_get_nameunit ( dev ) ) ; dev -> busy -- ; if ( dev -> busy == 0 ) { if ( dev -> parent ) device_unbusy ( dev -> parent ) ; if ( dev -> state == DS_BUSY ) dev -> state = DS_ATTACHED ; } }
@brief Decrement the busy counter for the device
@brief Decrement the busy counter for the device