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

Function resource_find_dev

freebsd/kern/subr_hints.c:459–475  ·  view source on GitHub ↗

* err = resource_find_dev(&anchor, name, &unit, res, value); * Iterate through a list of devices, returning their unit numbers. * res and value are optional restrictions. eg: "at", "scbus0". * *unit is set to the value. * set *anchor to zero before starting. */

Source from the content-addressed store, hash-verified

457 * set *anchor to zero before starting.
458 */
459int
460resource_find_dev(int *anchor, const char *name, int *unit,
461 const char *resname, const char *value)
462{
463 int found_unit;
464 int newln;
465 int ret;
466
467 newln = *anchor;
468 ret = resource_find(anchor, &newln, name, NULL, resname, value,
469 NULL, NULL, &found_unit, NULL, NULL, NULL);
470 if (ret == 0) {
471 *unit = found_unit;
472 }
473 *anchor = newln;
474 return ret;
475}
476
477/*
478 * Check to see if a device is disabled via a disabled hint.

Callers

nothing calls this directly

Calls 1

resource_findFunction · 0.70

Tested by

no test coverage detected