mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-01 08:27:59 +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:
parent
98c3b7810b
commit
6591b31040
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117166
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user