diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2007-03-27 21:03:37 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2007-03-27 21:03:37 +0000 |
commit | 2e4f7510d94a26f1cd9ae67ea9c88535cea9c193 (patch) | |
tree | c7550e0408ca0d79f56a9e6d3c0a0ca79a6f86e2 /sys/dev/mk48txx | |
parent | 2f20235351089bb6e52be91ffa6c7bf6ded46a69 (diff) | |
download | FreeBSD-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/dev/mk48txx')
-rw-r--r-- | sys/dev/mk48txx/mk48txx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/mk48txx/mk48txx.c b/sys/dev/mk48txx/mk48txx.c index fbc03c4..71ab8f5 100644 --- a/sys/dev/mk48txx/mk48txx.c +++ b/sys/dev/mk48txx/mk48txx.c @@ -295,9 +295,9 @@ mk48txx_watchdog(void *arg, u_int cmd, int *error) dev = arg; sc = device_get_softc(dev); - wdog = 0; t = cmd & WD_INTERVAL; - if (cmd > 0 && t >= 26 && t <= 37) { + if (t >= 26 && t <= 37) { + wdog = 0; if (t <= WD_TO_2SEC) { wdog |= MK48TXX_WDOG_RB_1_16; t -= 26; @@ -317,8 +317,8 @@ mk48txx_watchdog(void *arg, u_int cmd, int *error) if (sc->sc_flag & MK48TXX_WDOG_ENABLE_WDS) wdog |= MK48TXX_WDOG_WDS; *error = 0; - } else if (cmd > 0) { - *error = EINVAL; + } else { + wdog = 0; } mtx_lock(&sc->sc_mtx); (*sc->sc_nvwr)(dev, sc->sc_clkoffset + MK48TXX_WDOG, wdog); |