git: 5a03f17a9adb - main - acpi_tz: Lookup devclass by name when needed.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Thu, 21 Apr 2022 17:30:02 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=5a03f17a9adb1587ec045c45fabfd70922dee66b

commit 5a03f17a9adb1587ec045c45fabfd70922dee66b
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-21 17:29:13 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-21 17:29:13 +0000

    acpi_tz: Lookup devclass by name when needed.
    
    Cache the value in a local variable in the worker thread.
    
    Reviewed by:    imp
    Differential Revision:  https://reviews.freebsd.org/D34992
---
 sys/dev/acpica/acpi_thermal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c
index 9ff86ae8d827..f6b19f56b862 100644
--- a/sys/dev/acpica/acpi_thermal.c
+++ b/sys/dev/acpica/acpi_thermal.c
@@ -331,7 +331,7 @@ acpi_tz_startup(void *arg __unused)
     device_t *devs;
     int devcount, error, i;
 
-    devclass_get_devices(acpi_tz_devclass, &devs, &devcount);
+    devclass_get_devices(devclass_find("acpi_tz"), &devs, &devcount);
     if (devcount == 0) {
 	free(devs, M_TEMP);
 	return;
@@ -949,6 +949,7 @@ acpi_tz_power_profile(void *arg)
 static void
 acpi_tz_thread(void *arg)
 {
+    devclass_t	acpi_tz_devclass;
     device_t	*devs;
     int		devcount, i;
     int		flags;
@@ -956,6 +957,7 @@ acpi_tz_thread(void *arg)
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
+    acpi_tz_devclass = devclass_find("acpi_tz");
     devs = NULL;
     devcount = 0;
     sc = NULL;