Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Mar 2026 18:54:34 +0000
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 703901bce15b - main - i6300esbwd: Set error appropriately on event
Message-ID:  <69b45d6a.323fe.315f786c@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by jhibbits:

URL: https://cgit.FreeBSD.org/src/commit/?id=703901bce15bdd746cb20ab3fc88f5859924cf76

commit 703901bce15bdd746cb20ab3fc88f5859924cf76
Author:     Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2026-03-13 18:49:17 +0000
Commit:     Justin Hibbits <jhibbits@FreeBSD.org>
CommitDate: 2026-03-13 18:49:17 +0000

    i6300esbwd: Set error appropriately on event
    
    Per the watchdog driver contract, if the driver successfully arms the
    watchdog it must set error to 0, and if it's unable to arm the watchdog
    it must leave error alone.
    
    Sponsored by:   Hewlett Packard Enterprise
---
 sys/dev/ichwd/i6300esbwd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/dev/ichwd/i6300esbwd.c b/sys/dev/ichwd/i6300esbwd.c
index 03d504a350aa..e810dcd888c4 100644
--- a/sys/dev/ichwd/i6300esbwd.c
+++ b/sys/dev/ichwd/i6300esbwd.c
@@ -112,7 +112,6 @@ i6300esbwd_event(void *arg, unsigned int cmd, int *error)
 	cmd &= WD_INTERVAL;
 	if (cmd != 0 &&
 	    (cmd < WD_TO_1MS || (cmd - WD_TO_1MS) >= WDT_PRELOAD_BIT)) {
-		*error = EINVAL;
 		return;
 	}
 	timeout = 1 << (cmd - WD_TO_1MS);
@@ -148,6 +147,8 @@ i6300esbwd_event(void *arg, unsigned int cmd, int *error)
 		regval = i6300esbwd_lock_read(sc);
 		sc->locked = regval & WDT_LOCK;
 	}
+	/* Set error to 0 to indicate we did something. */
+	*error = 0;
 }
 
 static int


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69b45d6a.323fe.315f786c>