* 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. */
| 457 | * set *anchor to zero before starting. |
| 458 | */ |
| 459 | int |
| 460 | resource_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. |
nothing calls this directly
no test coverage detected