aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/i386/geode.c
diff options
context:
space:
mode:
authorNick Hibma <n_hibma@FreeBSD.org>2007-03-27 21:03:37 +0000
committerNick Hibma <n_hibma@FreeBSD.org>2007-03-27 21:03:37 +0000
commitf29fa1dfa4c73d0ad8ae958e4cb0160232473309 (patch)
treec7550e0408ca0d79f56a9e6d3c0a0ca79a6f86e2 /sys/i386/i386/geode.c
parent5de558219a10a51c05dea62a77cf834585895a55 (diff)
downloadsrc-f29fa1dfa4c73d0ad8ae958e4cb0160232473309.tar.gz
src-f29fa1dfa4c73d0ad8ae958e4cb0160232473309.zip
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
Notes
Notes: svn path=/head/; revision=167950
Diffstat (limited to 'sys/i386/i386/geode.c')
-rw-r--r--sys/i386/i386/geode.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/i386/i386/geode.c b/sys/i386/i386/geode.c
index 14d73ea70273..650dcba08b03 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 {