1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-29 08:08:37 +00:00

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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117166
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,