From 2e4f7510d94a26f1cd9ae67ea9c88535cea9c193 Mon Sep 17 00:00:00 2001 From: n_hibma Date: Tue, 27 Mar 2007 21:03:37 +0000 Subject: 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 --- sys/arm/xscale/i80321/i80321_wdog.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sys/arm/xscale/i80321') 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<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; } } -- cgit v1.1