MCPcopy Create free account
hub / github.com/F-Stack/f-stack / firmware_put

Function firmware_put

freebsd/kern/subr_firmware.c:357–373  ·  view source on GitHub ↗

* Release a reference to a firmware image returned by firmware_get. * The caller may specify, with the FIRMWARE_UNLOAD flag, its desire * to release the resource, but the flag is only advisory. * * If this is the last reference to the firmware image, and this is an * autoloaded module, wake up the firmware_unload_task to figure out * what to do with the associated module. */

Source from the content-addressed store, hash-verified

355 * what to do with the associated module.
356 */
357void
358firmware_put(const struct firmware *p, int flags)
359{
360 struct priv_fw *fp = PRIV_FW(p);
361
362 mtx_lock(&firmware_mtx);
363 fp->refcnt--;
364 if (fp->refcnt == 0) {
365 if (fp->parent != NULL)
366 fp->parent->refcnt--;
367 if (flags & FIRMWARE_UNLOAD)
368 fp->flags |= FW_UNLOAD;
369 if (fp->file)
370 taskqueue_enqueue(firmware_tq, &firmware_unload_task);
371 }
372 mtx_unlock(&firmware_mtx);
373}
374
375/*
376 * Setup directory state for the firmware_tq thread so we can do i/o.

Callers 1

load_fwFunction · 0.85

Calls 3

taskqueue_enqueueFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected