summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2019-07-03 22:12:31 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2019-07-03 22:12:31 +0000
commitd5cb3b4efc31fe576d9835223fa53e89d6671346 (patch)
treeb6cbc16c3c2fffe00da07227bc9b5f1a9f605d49
parent834bac05cbe00aafbdb50537f181965d4e2a43dc (diff)
Skip thermal zones without "trips" or "cooling-maps" nodes.
-rw-r--r--sys/dev/ofw/ofw_thermal.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ofw/ofw_thermal.c b/sys/dev/ofw/ofw_thermal.c
index 562866f7f36..9a1bc6866a9 100644
--- a/sys/dev/ofw/ofw_thermal.c
+++ b/sys/dev/ofw/ofw_thermal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ofw_thermal.c,v 1.2 2019/07/03 21:20:14 kettenis Exp $ */
+/* $OpenBSD: ofw_thermal.c,v 1.3 2019/07/03 22:12:30 kettenis Exp $ */
/*
* Copyright (c) 2019 Mark Kettenis
*
@@ -327,6 +327,11 @@ thermal_zone_init(int node)
if (len <= 0)
return;
+ if (OF_getnodebyname(node, "trips") == 0)
+ return;
+ if (OF_getnodebyname(node, "cooling-maps") == 0)
+ return;
+
tz = malloc(sizeof(struct thermal_zone), M_DEVBUF, M_ZERO | M_WAITOK);
tz->tz_node = node;