summaryrefslogtreecommitdiffstats
path: root/sys/arm/xscale/i80321
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/arm/xscale/i80321
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/arm/xscale/i80321')
-rw-r--r--sys/arm/xscale/i80321/i80321_wdog.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/arm/xscale/i80321/i80321_wdog.c b/sys/arm/xscale/i80321/i80321_wdog.c
index c6c749c..eff5f9d 100644
--- a/sys/arm/xscale/i80321/i80321_wdog.c
+++ b/sys/arm/xscale/i80321/i80321_wdog.c
@@ -111,18 +111,15 @@ iopwdog_watchdog_fn(void *private, u_int cmd, int *error)
cmd &= WD_INTERVAL;
if (cmd > 0 && cmd <= 63
- && (uint64_t)1 << (cmd & WD_INTERVAL) <=
- (uint64_t)sc->wdog_period * 1000000000) {
+ && (uint64_t)1<<cmd <= (uint64_t)sc->wdog_period * 1000000000) {
/* Valid value -> Enable watchdog */
iopwdog_tickle(sc);
sc->armed = 1;
*error = 0;
} else {
- /* XXX Can't disable this watchdog? */
+ /* Can't disable this watchdog! */
if (sc->armed)
*error = EOPNOTSUPP;
- else if (cmd > 0)
- *error = EINVAL;
}
}
OpenPOWER on IntegriCloud