Module Name: src
Committed By: pgoyette
Date: Sat Jul 17 21:51:43 UTC 2010
Modified Files:
src/sys/dev/isa: itesio_isa.c
Log Message:
Put the original NULL pmf handler establishment back where it started, so
as not to call it in some error paths.
Instead, if there is a watchdog present, deregister the NULL handler before
establishing the one for the watchdog.
To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/isa/itesio_isa.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/itesio_isa.c
diff -u src/sys/dev/isa/itesio_isa.c:1.19 src/sys/dev/isa/itesio_isa.c:1.20
--- src/sys/dev/isa/itesio_isa.c:1.19 Sat Jul 17 21:36:26 2010
+++ src/sys/dev/isa/itesio_isa.c Sat Jul 17 21:51:43 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: itesio_isa.c,v 1.19 2010/07/17 21:36:26 pgoyette Exp $ */
+/* $NetBSD: itesio_isa.c,v 1.20 2010/07/17 21:51:43 pgoyette Exp $ */
/* Derived from $OpenBSD: it.c,v 1.19 2006/04/10 00:57:54 deraadt Exp $ */
/*
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: itesio_isa.c,v 1.19 2010/07/17 21:36:26 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: itesio_isa.c,v 1.20 2010/07/17 21:51:43 pgoyette Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -251,6 +251,9 @@
}
sc->sc_hwmon_enabled = true;
+ if (!pmf_device_register(self, NULL, NULL))
+ aprint_error_dev(self, "couldn't establish power handler\n");
+
/* The IT8705 doesn't support the WDT */
if (sc->sc_chipid == ITESIO_ID8705)
goto out2;
@@ -271,6 +274,7 @@
sc->sc_wdt_enabled = true;
aprint_normal_dev(self, "Watchdog Timer present\n");
+ pmf_device_deregister(self);
if (!pmf_device_register(self, itesio_wdt_suspend, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
@@ -280,10 +284,6 @@
bus_space_unmap(sc->sc_iot, sc->sc_ec_ioh, 8);
out2:
bus_space_unmap(sc->sc_iot, sc->sc_pnp_ioh, 2);
-
- if (!pmf_device_register(self, NULL, NULL))
- aprint_error_dev(self, "couldn't establish power handler\n");
-
}
static int