Skip to content

Commit 6f824c9

Browse files
committed
Merge branch 'acpi-thermal'
* acpi-thermal: ACPI: thermal: Register thermal zones without valid trip points
2 parents da78193 + 8a4ff54 commit 6f824c9

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

drivers/acpi/thermal.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -662,14 +662,15 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz,
662662
{
663663
int result;
664664

665-
tz->thermal_zone = thermal_zone_device_register_with_trips("acpitz",
666-
trip_table,
667-
trip_count,
668-
tz,
669-
&acpi_thermal_zone_ops,
670-
NULL,
671-
passive_delay,
672-
tz->polling_frequency * 100);
665+
if (trip_count)
666+
tz->thermal_zone = thermal_zone_device_register_with_trips(
667+
"acpitz", trip_table, trip_count, tz,
668+
&acpi_thermal_zone_ops, NULL, passive_delay,
669+
tz->polling_frequency * 100);
670+
else
671+
tz->thermal_zone = thermal_tripless_zone_device_register(
672+
"acpitz", tz, &acpi_thermal_zone_ops, NULL);
673+
673674
if (IS_ERR(tz->thermal_zone))
674675
return PTR_ERR(tz->thermal_zone);
675676

@@ -901,11 +902,8 @@ static int acpi_thermal_add(struct acpi_device *device)
901902
trip++;
902903
}
903904

904-
if (trip == trip_table) {
905+
if (trip == trip_table)
905906
pr_warn(FW_BUG "No valid trip points!\n");
906-
result = -ENODEV;
907-
goto free_memory;
908-
}
909907

910908
result = acpi_thermal_register_thermal_zone(tz, trip_table,
911909
trip - trip_table,

0 commit comments

Comments
 (0)