summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_hints.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-07-02 16:01:38 +0000
committerjhb <jhb@FreeBSD.org>2003-07-02 16:01:38 +0000
commitea0bd1523805444400e26e89587d5f1a933ff7dd (patch)
treec41ae7e0b724b9b46a22f66ebca87ec6a645403f /sys/kern/subr_hints.c
parentedf662e5b9b8021849069f367722be529ea4104a (diff)
downloadFreeBSD-src-ea0bd1523805444400e26e89587d5f1a933ff7dd.zip
FreeBSD-src-ea0bd1523805444400e26e89587d5f1a933ff7dd.tar.gz
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.
Diffstat (limited to 'sys/kern/subr_hints.c')
-rw-r--r--sys/kern/subr_hints.c14
1 files changed, 14 insertions, 0 deletions
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);
+}
OpenPOWER on IntegriCloud