summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>2007-03-27 21:03:37 +0000
committern_hibma <n_hibma@FreeBSD.org>2007-03-27 21:03:37 +0000
commit2e4f7510d94a26f1cd9ae67ea9c88535cea9c193 (patch)
treec7550e0408ca0d79f56a9e6d3c0a0ca79a6f86e2 /sys/i386
parent2f20235351089bb6e52be91ffa6c7bf6ded46a69 (diff)
downloadFreeBSD-src-2e4f7510d94a26f1cd9ae67ea9c88535cea9c193.zip
FreeBSD-src-2e4f7510d94a26f1cd9ae67ea9c88535cea9c193.tar.gz
Revisit the watchdogs: Resetting the error to EINVAL after failing to set the
watchdog might hide the succesful arming of an earlier one. Accept that on failing to arm any watchdog (because of non-supported timeouts) EOPNOTSUPP is returned instead of the more appropriate EINVAL. MFC after: 3 days
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/elan-mmcr.c2
-rw-r--r--sys/i386/i386/geode.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/i386/i386/elan-mmcr.c b/sys/i386/i386/elan-mmcr.c
index be3e2a4..6556167 100644
--- a/sys/i386/i386/elan-mmcr.c
+++ b/sys/i386/i386/elan-mmcr.c
@@ -412,8 +412,6 @@ elan_watchdog(void *foo __unused, u_int spec, int *error)
elan_mmcr->WDTMRCTL = w; /* XXX What does this statement do? */
elan_mmcr->GPECHO = w;
cur = 0;
- if (u > 0)
- *error = 0;
}
}
diff --git a/sys/i386/i386/geode.c b/sys/i386/i386/geode.c
index 14d73ea..650dcba 100644
--- a/sys/i386/i386/geode.c
+++ b/sys/i386/i386/geode.c
@@ -136,7 +136,7 @@ geode_watchdog(void *foo __unused, u_int cmd, int *error)
u_int u, p, r;
u = cmd & WD_INTERVAL;
- if (cmd && u >= 14 && u <= 43) {
+ if (u >= 14 && u <= 43) {
u -= 14;
if (u > 16) {
p = u - 16;
@@ -165,7 +165,10 @@ geode_watchdog(void *foo __unused, u_int cmd, int *error)
static void
advantech_watchdog(void *foo __unused, u_int cmd, int *error)
{
- if (cmd && (cmd & WD_INTERVAL) <= WD_TO_1SEC) {
+ u_int u;
+
+ u = cmd & WD_INTERVAL;
+ if (u > 0 && u <= WD_TO_1SEC) {
outb(0x0443, 1);
*error = 0;
} else {
OpenPOWER on IntegriCloud