Initialize sensors states before registering.

This commit is contained in:
pgoyette 2011-06-20 17:29:06 +00:00
parent 19cf0602df
commit b9603c5a8f
2 changed files with 10 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: arcmsr.c,v 1.28 2011/06/20 13:26:58 pgoyette Exp $ */
/* $NetBSD: arcmsr.c,v 1.29 2011/06/20 17:29:06 pgoyette Exp $ */
/* $OpenBSD: arc.c,v 1.68 2007/10/27 03:28:27 dlg Exp $ */
/*
@ -21,7 +21,7 @@
#include "bio.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: arcmsr.c,v 1.28 2011/06/20 13:26:58 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: arcmsr.c,v 1.29 2011/06/20 17:29:06 pgoyette Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -1746,6 +1746,7 @@ arc_create_sensors(void *arg)
goto bad;
sc->sc_arc_sensors[count].arc_sensor.units = ENVSYS_DRIVE;
sc->sc_arc_sensors[count].arc_sensor.state = ENVSYS_SINVALID;
sc->sc_arc_sensors[count].arc_sensor.flags =
ENVSYS_FMONSTCHANGED;
@ -1773,6 +1774,8 @@ arc_create_sensors(void *arg)
/* Attach disk sensors for this volume */
for (j = 0; j < bv.bv_nodisk; j++) {
sc->sc_arc_sensors[count].arc_sensor.state =
ENVSYS_SINVALID;
sc->sc_arc_sensors[count].arc_sensor.units =
ENVSYS_DRIVE;
sc->sc_arc_sensors[count].arc_sensor.flags =

View File

@ -1,4 +1,4 @@
/* $NetBSD: viaenv.c,v 1.30 2010/12/10 21:20:09 phx Exp $ */
/* $NetBSD: viaenv.c,v 1.31 2011/06/20 17:29:06 pgoyette Exp $ */
/*
* Copyright (c) 2000 Johan Danielsson
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: viaenv.c,v 1.30 2010/12/10 21:20:09 phx Exp $");
__KERNEL_RCSID(0, "$NetBSD: viaenv.c,v 1.31 2011/06/20 17:29:06 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -343,6 +343,9 @@ viaenv_attach(device_t parent, device_t self, void *aux)
#undef COPYDESCR
for (i = 0; i < 10; i++)
sc->sc_sensor[i].state = ENVSYS_SINVALID;
sc->sc_sme = sysmon_envsys_create();
/* Initialize sensors */