Skip to contentSkip to conversation

watchdog: Stop looking for device as soon as one is found

PATCH New Samuel Tardieu 1 participant 1 message Nov 4, 2007 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: Stop looking for device as soon as one is found

If no address is given for the W83697HF/HG watchdog IO port, stop looping through possible locations when a watchdog device has been found.

---
 drivers/watchdog/w83697hf_wdt.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/watchdog/w83697hf_wdt.c +3 -1
index c622a0e..6ea125e 100644
@@ -382,8 +382,10 @@ wdt_init(void)
 		/* we will autodetect the W83697HF/HG watchdog */
 		for (i = 0; ((!found) && (w83697hf_ioports[i] != 0)); i++) {
 			wdt_io = w83697hf_ioports[i];
-			if (!w83697hf_check_wdt())
+			if (!w83697hf_check_wdt()) {
 				found++;
+				break;
+			}
 		}
 	} else {
 		if (!w83697hf_check_wdt())
Signature · 1 line
1.5.3.5