summaryrefslogtreecommitdiffstats
path: root/sys/i386/bios/apm.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-07-02 16:09:02 +0000
committerjhb <jhb@FreeBSD.org>2003-07-02 16:09:02 +0000
commit17958a749f60b50092d0ae5d6171bdc924cbed02 (patch)
tree24843831a3541cd5733aaad746e1a57206e1e21f /sys/i386/bios/apm.c
parentea0bd1523805444400e26e89587d5f1a933ff7dd (diff)
downloadFreeBSD-src-17958a749f60b50092d0ae5d6171bdc924cbed02.zip
FreeBSD-src-17958a749f60b50092d0ae5d6171bdc924cbed02.tar.gz
- Use the new resource_disabled() helper function to see if devices are
disabled. - Change the apm driver to match the acpi driver's behavior by checking to see if the device is disabled in the identify routine instead of in the probe routine. This way if the device is disabled it is never created. Note that a few places (ips(4), Alpha SMP) used "disable" instead of "disabled" for their hint names, and these hints must be changed to "disabled". If this is a big problem, resource_disabled() can always be changed to honor both names.
Diffstat (limited to 'sys/i386/bios/apm.c')
-rw-r--r--sys/i386/bios/apm.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c
index 016d924..f67bdbe 100644
--- a/sys/i386/bios/apm.c
+++ b/sys/i386/bios/apm.c
@@ -846,6 +846,9 @@ apm_identify(driver_t *driver, device_t parent)
return;
}
+ if (resource_disabled("apm", 0))
+ return;
+
child = BUS_ADD_CHILD(parent, 0, "apm", 0);
if (child == NULL)
panic("apm_identify");
@@ -860,18 +863,12 @@ apm_probe(device_t dev)
#define APM_KERNBASE KERNBASE
struct vm86frame vmf;
struct apm_softc *sc = &apm_softc;
- int disabled, flags;
+ int flags;
#ifdef PC98
int rid;
#endif
device_set_desc(dev, "APM BIOS");
-
- if (resource_int_value("apm", 0, "disabled", &disabled) != 0)
- disabled = 0;
- if (disabled)
- return ENXIO;
-
if (device_get_unit(dev) > 0) {
printf("apm: Only one APM driver supported.\n");
return ENXIO;
@@ -1544,10 +1541,8 @@ out:
static void
apm_pm_register(void *arg)
{
- int disabled = 0;
- resource_int_value("apm", 0, "disabled", &disabled);
- if (disabled == 0)
+ if (!resource_disabled("apm", 0))
power_pm_register(POWER_PM_TYPE_APM, apm_pm_func, NULL);
}
OpenPOWER on IntegriCloud