Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/isa Initialize sensors states before registering.



details:   https://anonhg.NetBSD.org/src/rev/abdfb42fabf8
branches:  trunk
changeset: 766323:abdfb42fabf8
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Mon Jun 20 18:12:54 2011 +0000

description:
Initialize sensors states before registering.

diffstat:

 sys/dev/isa/finsio_isa.c    |  5 +++--
 sys/dev/isa/itesio_isa.c    |  8 ++++++--
 sys/dev/isa/nsclpcsio_isa.c |  5 +++--
 sys/dev/isa/smsc.c          |  5 +++--
 4 files changed, 15 insertions(+), 8 deletions(-)

diffs (108 lines):

diff -r 756f061eb3e1 -r abdfb42fabf8 sys/dev/isa/finsio_isa.c
--- a/sys/dev/isa/finsio_isa.c  Mon Jun 20 18:12:06 2011 +0000
+++ b/sys/dev/isa/finsio_isa.c  Mon Jun 20 18:12:54 2011 +0000
@@ -1,5 +1,5 @@
 /*     $OpenBSD: fins.c,v 1.1 2008/03/19 19:33:09 deraadt Exp $        */
-/*     $NetBSD: finsio_isa.c,v 1.4 2008/04/22 13:33:38 xtraeme Exp $   */
+/*     $NetBSD: finsio_isa.c,v 1.5 2011/06/20 18:12:54 pgoyette Exp $  */
 
 /*
  * Copyright (c) 2008 Juan Romero Pardines
@@ -19,7 +19,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: finsio_isa.c,v 1.4 2008/04/22 13:33:38 xtraeme Exp $");
+__KERNEL_RCSID(0, "$NetBSD: finsio_isa.c,v 1.5 2011/06/20 18:12:54 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -542,6 +542,7 @@
         */
        sc->sc_sme = sysmon_envsys_create();
        for (i = 0; sc->sc_finsio_sensors[i].fs_desc; i++) {
+               sc->sc_sensor[i].state = ENVSYS_SINVALID;
                sc->sc_sensor[i].units = sc->sc_finsio_sensors[i].fs_type;
                if (sc->sc_sensor[i].units == ENVSYS_SVOLTS_DC)
                        sc->sc_sensor[i].flags = ENVSYS_FCHANGERFACT;
diff -r 756f061eb3e1 -r abdfb42fabf8 sys/dev/isa/itesio_isa.c
--- a/sys/dev/isa/itesio_isa.c  Mon Jun 20 18:12:06 2011 +0000
+++ b/sys/dev/isa/itesio_isa.c  Mon Jun 20 18:12:54 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: itesio_isa.c,v 1.21 2010/08/13 19:28:26 jakllsch Exp $ */
+/*     $NetBSD: itesio_isa.c,v 1.22 2011/06/20 18:12:54 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.21 2010/08/13 19:28:26 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: itesio_isa.c,v 1.22 2011/06/20 18:12:54 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -409,6 +409,10 @@
        COPYDESCR(sc->sc_sensor[12].desc, "CPU Fan");
        COPYDESCR(sc->sc_sensor[13].desc, "System Fan");
        COPYDESCR(sc->sc_sensor[14].desc, "Aux Fan");
+
+       /* all */
+       for (i = 0; i < IT_NUM_SENSORS; i++)
+               sc->sc_sensor[i].state = ENVSYS_SINVALID;
 }
 #undef COPYDESCR
 
diff -r 756f061eb3e1 -r abdfb42fabf8 sys/dev/isa/nsclpcsio_isa.c
--- a/sys/dev/isa/nsclpcsio_isa.c       Mon Jun 20 18:12:06 2011 +0000
+++ b/sys/dev/isa/nsclpcsio_isa.c       Mon Jun 20 18:12:54 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nsclpcsio_isa.c,v 1.28 2008/11/12 12:36:12 ad Exp $ */
+/* $NetBSD: nsclpcsio_isa.c,v 1.29 2011/06/20 18:12:54 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2002
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nsclpcsio_isa.c,v 1.28 2008/11/12 12:36:12 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nsclpcsio_isa.c,v 1.29 2011/06/20 18:12:54 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -309,6 +309,7 @@
 
        sme = sysmon_envsys_create();
        for (i = 0; i < SIO_NUM_SENSORS; i++) {
+               sc->sc_sensor[i].state = ENVSYS_SINVALID;
                if (sysmon_envsys_sensor_attach(sme, &sc->sc_sensor[i]) != 0) {
                        aprint_error_dev(sc->sc_dev,
                            "could not attach sensor %d", i);
diff -r 756f061eb3e1 -r abdfb42fabf8 sys/dev/isa/smsc.c
--- a/sys/dev/isa/smsc.c        Mon Jun 20 18:12:06 2011 +0000
+++ b/sys/dev/isa/smsc.c        Mon Jun 20 18:12:54 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smsc.c,v 1.9 2009/05/12 09:10:16 cegger Exp $ */
+/*     $NetBSD: smsc.c,v 1.10 2011/06/20 18:12:54 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smsc.c,v 1.9 2009/05/12 09:10:16 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smsc.c,v 1.10 2011/06/20 18:12:54 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -212,6 +212,7 @@
        INITSENSOR(7, "Fan3", SMSC_FAN4_LSB, ENVSYS_SFANRPM);
 
        for (i = 0; i < SMSC_MAX_SENSORS; i++) {
+               sc->sc_sensor[i].state = ENVSYS_SINVALID;
                if (sysmon_envsys_sensor_attach(sc->sc_sme,
                                                &sc->sc_sensor[i])) {
                        sysmon_envsys_destroy(sc->sc_sme);



Home | Main Index | Thread Index | Old Index