summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi_thermal.c
diff options
context:
space:
mode:
authoriwasaki <iwasaki@FreeBSD.org>2001-11-15 12:00:48 +0000
committeriwasaki <iwasaki@FreeBSD.org>2001-11-15 12:00:48 +0000
commitfb3ee113a4d548242e19dd9a6f7bb51e130e24ad (patch)
treee4914fd5644b8bc0804c485f51ad787d8c214870 /sys/dev/acpica/acpi_thermal.c
parent62ec3c0b4b396023f14362c8f7f91d5392fd1118 (diff)
downloadFreeBSD-src-fb3ee113a4d548242e19dd9a6f7bb51e130e24ad.zip
FreeBSD-src-fb3ee113a4d548242e19dd9a6f7bb51e130e24ad.tar.gz
Two minor changes.
- Change _ACx sysctl oid from ten of _AC[0-9] to one _ACx. - Better error printing on _TMP evaluation. Reviewed by: msmith
Diffstat (limited to 'sys/dev/acpica/acpi_thermal.c')
-rw-r--r--sys/dev/acpica/acpi_thermal.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c
index 0cd35c2..dc414bf 100644
--- a/sys/dev/acpica/acpi_thermal.c
+++ b/sys/dev/acpica/acpi_thermal.c
@@ -166,7 +166,6 @@ acpi_tz_attach(device_t dev)
struct acpi_softc *acpi_sc;
int error;
char oidname[8];
- int i;
FUNCTION_TRACE(__func__);
@@ -230,12 +229,10 @@ acpi_tz_attach(device_t dev)
SYSCTL_ADD_INT(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
OID_AUTO, "_CRT", CTLFLAG_RD,
&sc->tz_zone.crt, 0, "");
- for (i = 0; i < TZ_NUMLEVELS; i++) {
- sprintf(oidname, "_AC%d", i);
- SYSCTL_ADD_INT(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
- OID_AUTO, oidname, CTLFLAG_RD,
- &sc->tz_zone.ac[i], 0, "");
- }
+ SYSCTL_ADD_OPAQUE(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
+ OID_AUTO, "_ACx", CTLFLAG_RD, &sc->tz_zone.ac,
+ sizeof(sc->tz_zone.ac), "I", "");
+
/*
* Register our power profile event handler, and flag it for a manual
@@ -360,6 +357,7 @@ acpi_tz_monitor(struct acpi_tz_softc *sc)
int i;
int newactive, newflags;
struct timespec curtime;
+ ACPI_STATUS status;
FUNCTION_TRACE(__func__);
@@ -368,8 +366,9 @@ acpi_tz_monitor(struct acpi_tz_softc *sc)
/*
* Get the current temperature.
*/
- if ((acpi_EvaluateInteger(sc->tz_handle, "_TMP", &temp)) != AE_OK) {
- device_printf(sc->tz_dev, "error fetching current temperature\n");
+ if ((status = acpi_EvaluateInteger(sc->tz_handle, "_TMP", &temp)) != AE_OK) {
+ device_printf(sc->tz_dev, "error fetching current temperature -- %s\n",
+ AcpiFormatException(status));
/* XXX disable zone? go to max cooling? */
return_VOID;
}
OpenPOWER on IntegriCloud