FreeBSD/sys/kern/subr_bus.c
/**
 * @brief Fully release a reserved resource
 *
 * Fully releases a resource reserved via resource_list_reserve().
 *
 * @param rl		the resource list which was allocated from
 * @param bus		the parent device of @p child
 * @param child		the device whose reserved resource is being released
 * @param type		the type of resource to release
 * @param rid		the resource identifier
 * @param res		the resource to release
 *
 * @retval 0		success
 * @retval non-zero	a standard unix error code indicating what
 *			error condition prevented the operation
 */
@brief Fully release a reserved resource
Fully releases a resource reserved via resource_list_reserve().



@retval 0            success
@retval non-zero     a standard unix error code indicating what
error condition prevented the operation
@brief Fully release a reserved resource Fully releases a resource reserved via resource_list_reserve () . @retval 0 success @retval non - zero a standard unix error code indicating what error condition prevented the operation
int
resource_list_unreserve(struct resource_list *rl, device_t bus, device_t child,
    int type, int rid)
{
	struct resource_list_entry *rle = NULL;
	int passthrough = (device_get_parent(child) != bus);
	if (passthrough)
		panic(
    "resource_list_unreserve() should only be called for direct children");
	rle = resource_list_find(rl, type, rid);
	if (!rle)
		panic("resource_list_unreserve: can't find resource");
	if (!(rle->flags & RLE_RESERVED))
		return (EINVAL);
	if (rle->flags & RLE_ALLOCATED)
		return (EBUSY);
	rle->flags &= ~RLE_RESERVED;
	return (resource_list_release(rl, bus, child, type, rid, rle->res));
}
int resource_list_unreserve ( struct resource_list * rl , device_t bus , device_t child , int type , int rid ) { struct resource_list_entry * rle = NULL ; int passthrough = ( device_get_parent ( child ) != bus ) ; if ( passthrough ) panic ( " " ) ; rle = resource_list_find ( rl , type , rid ) ; if ( ! rle ) panic ( " " ) ; if ( ! ( rle -> flags & RLE_RESERVED ) ) return ( EINVAL ) ; if ( rle -> flags & RLE_ALLOCATED ) return ( EBUSY ) ; rle -> flags &= ~ RLE_RESERVED ; return ( resource_list_release ( rl , bus , child , type , rid , rle -> res ) ) ; }
@brief Fully release a reserved resource
 Fully releases a resource reserved via resource_list_reserve().
@brief Fully release a reserved resource Fully releases a resource reserved via resource_list_reserve () .