Add a resource_disabled() helper function that returns true (non-zero) if

a specified resource has been disabled via a non-zero 'disabled' hint and
false otherwise.
This commit is contained in:
John Baldwin 2003-07-02 16:01:38 +00:00
parent 98c3b7810b
commit 6591b31040
2 changed files with 15 additions and 0 deletions

View File

@ -365,3 +365,17 @@ resource_find_dev(int *anchor, const char *name, int *unit,
*anchor = newln;
return ret;
}
/*
* Check to see if a device is disabled via a disabled hint.
*/
int
resource_disabled(const char *name, int unit)
{
int error, value;
error = resource_int_value(name, unit, "disabled", &value);
if (error)
return (0);
return (value);
}

View File

@ -353,6 +353,7 @@ int resource_long_value(const char *name, int unit, const char *resname,
long *result);
int resource_string_value(const char *name, int unit, const char *resname,
const char **result);
int resource_disabled(const char *name, int unit);
int resource_find_match(int *anchor, const char **name, int *unit,
const char *resname, const char *value);
int resource_find_dev(int *anchor, const char *name, int *unit,