Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/dev Initialize sensor states before registe...
details: https://anonhg.NetBSD.org/src/rev/b0f079104c9e
branches: trunk
changeset: 766312:b0f079104c9e
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Mon Jun 20 17:01:45 2011 +0000
description:
Initialize sensor states before registering.
diffstat:
sys/arch/sparc64/dev/lom.c | 8 ++++++--
sys/arch/sparc64/dev/pcf8591_envctrl.c | 3 ++-
2 files changed, 8 insertions(+), 3 deletions(-)
diffs (67 lines):
diff -r 4852a0de5b62 -r b0f079104c9e sys/arch/sparc64/dev/lom.c
--- a/sys/arch/sparc64/dev/lom.c Mon Jun 20 16:33:42 2011 +0000
+++ b/sys/arch/sparc64/dev/lom.c Mon Jun 20 17:01:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lom.c,v 1.8 2011/06/19 21:37:10 nakayama Exp $ */
+/* $NetBSD: lom.c,v 1.9 2011/06/20 17:01:45 pgoyette Exp $ */
/* $OpenBSD: lom.c,v 1.21 2010/02/28 20:44:39 kettenis Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis
@@ -17,7 +17,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lom.c,v 1.8 2011/06/19 21:37:10 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lom.c,v 1.9 2011/06/20 17:01:45 pgoyette Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -351,6 +351,7 @@
sc->sc_sme = sysmon_envsys_create();
for (i = 0; i < sc->sc_num_alarm; i++) {
sc->sc_alarm[i].units = ENVSYS_INDICATOR;
+ sc->sc_alarm[i].state = ENVSYS_SINVALID;
snprintf(sc->sc_alarm[i].desc, sizeof(sc->sc_alarm[i].desc),
i == 0 ? "Fault LED" : "Alarm%d", i);
if (sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_alarm[i])) {
@@ -372,6 +373,7 @@
}
for (i = 0; i < sc->sc_num_fan; i++) {
sc->sc_fan[i].units = ENVSYS_SFANRPM;
+ sc->sc_fan[i].state = ENVSYS_SINVALID;
snprintf(sc->sc_fan[i].desc, sizeof(sc->sc_fan[i].desc),
"fan%d", i + 1);
if (sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_fan[i])) {
@@ -382,6 +384,7 @@
}
for (i = 0; i < sc->sc_num_psu; i++) {
sc->sc_psu[i].units = ENVSYS_INDICATOR;
+ sc->sc_psu[i].state = ENVSYS_SINVALID;
snprintf(sc->sc_psu[i].desc, sizeof(sc->sc_psu[i].desc),
"PSU%d", i + 1);
if (sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_psu[i])) {
@@ -392,6 +395,7 @@
}
for (i = 0; i < sc->sc_num_temp; i++) {
sc->sc_temp[i].units = ENVSYS_STEMP;
+ sc->sc_temp[i].state = ENVSYS_SINVALID;
snprintf(sc->sc_temp[i].desc, sizeof(sc->sc_temp[i].desc),
"temp%d", i + 1);
if (sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_temp[i])) {
diff -r 4852a0de5b62 -r b0f079104c9e sys/arch/sparc64/dev/pcf8591_envctrl.c
--- a/sys/arch/sparc64/dev/pcf8591_envctrl.c Mon Jun 20 16:33:42 2011 +0000
+++ b/sys/arch/sparc64/dev/pcf8591_envctrl.c Mon Jun 20 17:01:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcf8591_envctrl.c,v 1.4 2011/04/03 06:22:02 jdc Exp $ */
+/* $NetBSD: pcf8591_envctrl.c,v 1.5 2011/06/20 17:01:45 pgoyette Exp $ */
/* $OpenBSD: pcf8591_envctrl.c,v 1.6 2007/10/25 21:17:20 kettenis Exp $ */
/*
@@ -137,6 +137,7 @@
sensor = &sc->sc_channels[sc->sc_nchan].chan_sensor;
sensor->units = ENVSYS_STEMP;
sensor->flags |= ENVSYS_FMONLIMITS;
+ sensor->state = ENVSYS_SINVALID;
strlcpy(sensor->desc, desc, sizeof(sensor->desc));
if (strncmp(desc, "CPU", 3) == 0)
Home |
Main Index |
Thread Index |
Old Index