From ea0bd1523805444400e26e89587d5f1a933ff7dd Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 2 Jul 2003 16:01:38 +0000 Subject: 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. --- sys/kern/subr_hints.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sys/kern/subr_hints.c') diff --git a/sys/kern/subr_hints.c b/sys/kern/subr_hints.c index 93a1391..0aeb553 100644 --- a/sys/kern/subr_hints.c +++ b/sys/kern/subr_hints.c @@ -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); +} -- cgit v1.1