diff options
author | Nick Hibma <n_hibma@FreeBSD.org> | 2007-03-27 21:03:37 +0000 |
---|---|---|
committer | Nick Hibma <n_hibma@FreeBSD.org> | 2007-03-27 21:03:37 +0000 |
commit | f29fa1dfa4c73d0ad8ae958e4cb0160232473309 (patch) | |
tree | c7550e0408ca0d79f56a9e6d3c0a0ca79a6f86e2 /sys/i386 | |
parent | 5de558219a10a51c05dea62a77cf834585895a55 (diff) | |
download | src-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')
-rw-r--r-- | sys/i386/i386/elan-mmcr.c | 2 | ||||
-rw-r--r-- | sys/i386/i386/geode.c | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/i386/i386/elan-mmcr.c b/sys/i386/i386/elan-mmcr.c index be3e2a45c9a3..6556167d57b9 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 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 { |