Module Name: src Committed By: martin Date: Mon Apr 16 14:28:24 UTC 2018
Modified Files: src/sys/dev/isa [netbsd-8]: wbsio.c Log Message: Pull up following revision(s) (requested by yamaguchi in ticket #765): sys/dev/isa/wbsio.c: revision 1.22 Handle watchdog attachment in the wbsio_rescan() function, where we take care of other children. ok knakahara@ and yamaguchi@ To generate a diff of this commit: cvs rdiff -u -r1.10.10.2 -r1.10.10.3 src/sys/dev/isa/wbsio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/isa/wbsio.c diff -u src/sys/dev/isa/wbsio.c:1.10.10.2 src/sys/dev/isa/wbsio.c:1.10.10.3 --- src/sys/dev/isa/wbsio.c:1.10.10.2 Mon Feb 19 18:50:35 2018 +++ src/sys/dev/isa/wbsio.c Mon Apr 16 14:28:23 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: wbsio.c,v 1.10.10.2 2018/02/19 18:50:35 snj Exp $ */ +/* $NetBSD: wbsio.c,v 1.10.10.3 2018/04/16 14:28:23 martin Exp $ */ /* $OpenBSD: wbsio.c,v 1.10 2015/03/14 03:38:47 jsg Exp $ */ /* * Copyright (c) 2008 Mark Kettenis <kette...@openbsd.org> @@ -284,8 +284,7 @@ wbsio_attach(device_t parent, device_t s if (!pmf_device_register(self, wbsio_suspend, NULL)) aprint_error_dev(self, "couldn't establish power handler\n"); - wbsio_wdog_attach(self); - + sc->sc_smw_valid = false; wbsio_rescan(self, "wbsio", NULL); #if NGPIO > 0 @@ -336,6 +335,8 @@ wbsio_rescan(device_t self, const char * #endif config_search_loc(wbsio_search, self, ifattr, locators, NULL); + wbsio_wdog_attach(self); + return 0; } @@ -799,7 +800,8 @@ wbsio_wdog_attach(device_t self) uint16_t devid; uint8_t rev; - sc->sc_smw_valid = false; + if (sc->sc_smw_valid) + return; /* watchdog already attached */ wbsio_conf_enable(&sc->sc_conf_lock, sc->sc_iot, sc->sc_ioh); devid = wbsio_conf_read(sc->sc_iot, sc->sc_ioh, WBSIO_ID);