FreeBSD/sys/dev/bhnd/bhndb/bhndb_subr.c
/**
 * Release a reference to @p dwa previously retained by @p res. If the
 * reference count of @p dwa reaches zero, it will be added to the
 * free list.
 * 
 * @param br The resource state owning @p dwa.
 * @param dwa The allocation record to be released.
 * @param res The resource that currently owns a reference to @p dwa.
 */
Release a reference to @p dwa previously retained by @p res. If the
reference count of @p dwa reaches zero, it will be added to the
free list.

@param br The resource state owning @p dwa.
@param dwa The allocation record to be released.
@param res The resource that currently owns a reference to @p dwa.
Release a reference to @p dwa previously retained by @p res . If the reference count of @p dwa reaches zero it will be added to the free list . @param br The resource state owning @p dwa . @param dwa The allocation record to be released . @param res The resource that currently owns a reference to @p dwa .
void
bhndb_dw_release(struct bhndb_resources *br, struct bhndb_dw_alloc *dwa,
    struct resource *r)
{
	struct bhndb_dw_rentry	*rentry;
	rentry = bhndb_dw_find_resource_entry(dwa, r);
	KASSERT(rentry != NULL, ("over release of resource entry"));
	LIST_REMOVE(rentry, dw_link);
	free(rentry, M_BHND);
	if (LIST_EMPTY(&dwa->refs))
		br->dwa_freelist |= (1 << (dwa->rnid));
}
void bhndb_dw_release ( struct bhndb_resources * br , struct bhndb_dw_alloc * dwa , struct resource * r ) { struct bhndb_dw_rentry * rentry ; rentry = bhndb_dw_find_resource_entry ( dwa , r ) ; KASSERT ( rentry != NULL , ( " " ) ) ; LIST_REMOVE ( rentry , dw_link ) ; free ( rentry , M_BHND ) ; if ( LIST_EMPTY ( & dwa -> refs ) ) br -> dwa_freelist |= ( 1 << ( dwa -> rnid ) ) ; }
Release a reference to @p dwa previously retained by @p res.
Release a reference to @p dwa previously retained by @p res .
/* Find the rentry */ /* If this was the last reference, update the free list */