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
@ -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