diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-04-05 21:17:48 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-04-05 21:17:48 +0300 |
commit | 6f824c9fccd494319988fa529601923edf5caacb (patch) | |
tree | 53c55490414d76e997f8f7279834ff29e9fd8ee9 | |
parent | da781936e7c301e6197eb6513775748e79fb2575 (diff) | |
parent | 8a4ff5452dd0cdcc35940460bb777d836bece11c (diff) | |
download | linux-6f824c9fccd494319988fa529601923edf5caacb.tar.xz |
Merge branch 'acpi-thermal'
* acpi-thermal:
ACPI: thermal: Register thermal zones without valid trip points
-rw-r--r-- | drivers/acpi/thermal.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 302dce0b2b50..d67881b50bca 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -662,14 +662,15 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz, { int result; - tz->thermal_zone = thermal_zone_device_register_with_trips("acpitz", - trip_table, - trip_count, - tz, - &acpi_thermal_zone_ops, - NULL, - passive_delay, - tz->polling_frequency * 100); + if (trip_count) + tz->thermal_zone = thermal_zone_device_register_with_trips( + "acpitz", trip_table, trip_count, tz, + &acpi_thermal_zone_ops, NULL, passive_delay, + tz->polling_frequency * 100); + else + tz->thermal_zone = thermal_tripless_zone_device_register( + "acpitz", tz, &acpi_thermal_zone_ops, NULL); + if (IS_ERR(tz->thermal_zone)) return PTR_ERR(tz->thermal_zone); @@ -901,11 +902,8 @@ static int acpi_thermal_add(struct acpi_device *device) trip++; } - if (trip == trip_table) { + if (trip == trip_table) pr_warn(FW_BUG "No valid trip points!\n"); - result = -ENODEV; - goto free_memory; - } result = acpi_thermal_register_thermal_zone(tz, trip_table, trip - trip_table, |