Module Name: src Committed By: pgoyette Date: Mon Jun 20 17:21:50 UTC 2011
Modified Files: src/sys/dev/acpi: acpi_fan.c acpi_pmtr.c acpi_tz.c aibs_acpi.c Log Message: Initialize sensors states before registering. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/dev/acpi/acpi_fan.c \ src/sys/dev/acpi/acpi_pmtr.c cvs rdiff -u -r1.81 -r1.82 src/sys/dev/acpi/acpi_tz.c cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/aibs_acpi.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/acpi/acpi_fan.c diff -u src/sys/dev/acpi/acpi_fan.c:1.4 src/sys/dev/acpi/acpi_fan.c:1.5 --- src/sys/dev/acpi/acpi_fan.c:1.4 Wed Feb 16 09:05:12 2011 +++ src/sys/dev/acpi/acpi_fan.c Mon Jun 20 17:21:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_fan.c,v 1.4 2011/02/16 09:05:12 jruoho Exp $ */ +/* $NetBSD: acpi_fan.c,v 1.5 2011/06/20 17:21:50 pgoyette Exp $ */ /*- * Copyright (c) 2011 Jukka Ruohonen <jruoho...@iki.fi> @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_fan.c,v 1.4 2011/02/16 09:05:12 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_fan.c,v 1.5 2011/06/20 17:21:50 pgoyette Exp $"); #include <sys/param.h> #include <sys/module.h> @@ -172,6 +172,7 @@ acpifan_sensor_state(self); sc->sc_sensor.units = ENVSYS_INDICATOR; + sc->sc_sensor.state = ENVSYS_SINVALID; (void)strlcpy(sc->sc_sensor.desc, "state", sizeof(sc->sc_sensor.desc)); Index: src/sys/dev/acpi/acpi_pmtr.c diff -u src/sys/dev/acpi/acpi_pmtr.c:1.4 src/sys/dev/acpi/acpi_pmtr.c:1.5 --- src/sys/dev/acpi/acpi_pmtr.c:1.4 Fri Jun 3 18:50:36 2011 +++ src/sys/dev/acpi/acpi_pmtr.c Mon Jun 20 17:21:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_pmtr.c,v 1.4 2011/06/03 18:50:36 jruoho Exp $ */ +/* $NetBSD: acpi_pmtr.c,v 1.5 2011/06/20 17:21:50 pgoyette Exp $ */ /*- * Copyright (c) 2011 Jukka Ruohonen <jruoho...@iki.fi> @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_pmtr.c,v 1.4 2011/06/03 18:50:36 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_pmtr.c,v 1.5 2011/06/20 17:21:50 pgoyette Exp $"); #include <sys/param.h> #include <sys/module.h> @@ -338,6 +338,8 @@ sc->sc_sensor_o.units = ENVSYS_SWATTS; sc->sc_sensor_i.value_cur = val * 1000; sc->sc_sensor_o.value_cur = val * 1000; + sc->sc_sensor_i.state = ENVSYS_SINVALID; + sc->sc_sensor_o.state = ENVSYS_SINVALID; acpipmtr_sensor_type(self); Index: src/sys/dev/acpi/acpi_tz.c diff -u src/sys/dev/acpi/acpi_tz.c:1.81 src/sys/dev/acpi/acpi_tz.c:1.82 --- src/sys/dev/acpi/acpi_tz.c:1.81 Mon Jun 20 15:36:49 2011 +++ src/sys/dev/acpi/acpi_tz.c Mon Jun 20 17:21:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_tz.c,v 1.81 2011/06/20 15:36:49 jruoho Exp $ */ +/* $NetBSD: acpi_tz.c,v 1.82 2011/06/20 17:21:50 pgoyette Exp $ */ /* * Copyright (c) 2003 Jared D. McNeill <jmcne...@invisible.ca> @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.81 2011/06/20 15:36:49 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.82 2011/06/20 17:21:50 pgoyette Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -774,6 +774,7 @@ sc->sc_temp_sensor.flags = flags; sc->sc_temp_sensor.units = ENVSYS_STEMP; + sc->sc_temp_sensor.state = ENVSYS_SINVALID; (void)strlcpy(sc->sc_temp_sensor.desc, "temperature", sizeof(sc->sc_temp_sensor.desc)); @@ -785,6 +786,7 @@ sc->sc_fan_sensor.flags = flags; sc->sc_fan_sensor.units = ENVSYS_SFANRPM; + sc->sc_fan_sensor.state = ENVSYS_SINVALID; (void)strlcpy(sc->sc_fan_sensor.desc, "FAN", sizeof(sc->sc_fan_sensor.desc)); Index: src/sys/dev/acpi/aibs_acpi.c diff -u src/sys/dev/acpi/aibs_acpi.c:1.1 src/sys/dev/acpi/aibs_acpi.c:1.2 --- src/sys/dev/acpi/aibs_acpi.c:1.1 Sun Jun 12 07:25:43 2011 +++ src/sys/dev/acpi/aibs_acpi.c Mon Jun 20 17:21:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: aibs_acpi.c,v 1.1 2011/06/12 07:25:43 jruoho Exp $ */ +/* $NetBSD: aibs_acpi.c,v 1.2 2011/06/20 17:21:50 pgoyette Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -47,7 +47,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: aibs_acpi.c,v 1.1 2011/06/12 07:25:43 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aibs_acpi.c,v 1.2 2011/06/20 17:21:50 pgoyette Exp $"); #include <sys/param.h> #include <sys/kmem.h> @@ -465,6 +465,7 @@ } (void)strlcpy(as->as_sensor.desc, name, sizeof(as->as_sensor.desc)); + as->as_sensor.state = ENVSYS_SINVALID; if (sysmon_envsys_sensor_attach(sc->sc_sme, &as->as_sensor) != 0) { rv = AE_AML_INTERNAL;