@@ -100,8 +100,6 @@ struct acpi_thermal_active {
100
100
struct acpi_thermal_trips {
101
101
struct acpi_thermal_passive passive ;
102
102
struct acpi_thermal_active active [ACPI_THERMAL_MAX_ACTIVE ];
103
- bool critical_valid ;
104
- bool hot_valid ;
105
103
};
106
104
107
105
struct acpi_thermal {
@@ -355,31 +353,26 @@ static long acpi_thermal_get_critical_trip(struct acpi_thermal *tz)
355
353
}
356
354
if (crt == -1 ) {
357
355
acpi_handle_debug (tz -> device -> handle , "Critical threshold disabled\n" );
358
- goto fail ;
356
+ return THERMAL_TEMP_INVALID ;
359
357
}
360
358
361
359
status = acpi_evaluate_integer (tz -> device -> handle , "_CRT" , NULL , & tmp );
362
360
if (ACPI_FAILURE (status )) {
363
361
acpi_handle_debug (tz -> device -> handle , "No critical threshold\n" );
364
- goto fail ;
362
+ return THERMAL_TEMP_INVALID ;
365
363
}
366
364
if (tmp <= 2732 ) {
367
365
/*
368
366
* Below zero (Celsius) values clearly aren't right for sure,
369
367
* so discard them as invalid.
370
368
*/
371
369
pr_info (FW_BUG "Invalid critical threshold (%llu)\n" , tmp );
372
- goto fail ;
370
+ return THERMAL_TEMP_INVALID ;
373
371
}
374
372
375
373
set :
376
- tz -> trips .critical_valid = true;
377
374
acpi_handle_debug (tz -> device -> handle , "Critical threshold [%llu]\n" , tmp );
378
375
return tmp ;
379
-
380
- fail :
381
- tz -> trips .critical_valid = false;
382
- return THERMAL_TEMP_INVALID ;
383
376
}
384
377
385
378
static long acpi_thermal_get_hot_trip (struct acpi_thermal * tz )
@@ -389,12 +382,10 @@ static long acpi_thermal_get_hot_trip(struct acpi_thermal *tz)
389
382
390
383
status = acpi_evaluate_integer (tz -> device -> handle , "_HOT" , NULL , & tmp );
391
384
if (ACPI_FAILURE (status )) {
392
- tz -> trips .hot_valid = false;
393
385
acpi_handle_debug (tz -> device -> handle , "No hot threshold\n" );
394
386
return THERMAL_TEMP_INVALID ;
395
387
}
396
388
397
- tz -> trips .hot_valid = true;
398
389
acpi_handle_debug (tz -> device -> handle , "Hot threshold [%llu]\n" , tmp );
399
390
return tmp ;
400
391
}
@@ -792,7 +783,7 @@ static void acpi_thermal_aml_dependency_fix(struct acpi_thermal *tz)
792
783
*/
793
784
static void acpi_thermal_guess_offset (struct acpi_thermal * tz , long crit_temp )
794
785
{
795
- if (tz -> trips . critical_valid && crit_temp % 5 == 1 )
786
+ if (crit_temp != THERMAL_TEMP_INVALID && crit_temp % 5 == 1 )
796
787
tz -> kelvin_offset = 273100 ;
797
788
else
798
789
tz -> kelvin_offset = 273200 ;
@@ -853,11 +844,11 @@ static int acpi_thermal_add(struct acpi_device *device)
853
844
trip_count = acpi_thermal_get_trip_points (tz );
854
845
855
846
crit_temp = acpi_thermal_get_critical_trip (tz );
856
- if (tz -> trips . critical_valid )
847
+ if (crit_temp != THERMAL_TEMP_INVALID )
857
848
trip_count ++ ;
858
849
859
850
hot_temp = acpi_thermal_get_hot_trip (tz );
860
- if (tz -> trips . hot_valid )
851
+ if (hot_temp != THERMAL_TEMP_INVALID )
861
852
trip_count ++ ;
862
853
863
854
if (!trip_count ) {
@@ -891,13 +882,13 @@ static int acpi_thermal_add(struct acpi_device *device)
891
882
892
883
tz -> trip_table = trip ;
893
884
894
- if (tz -> trips . critical_valid ) {
885
+ if (crit_temp != THERMAL_TEMP_INVALID ) {
895
886
trip -> type = THERMAL_TRIP_CRITICAL ;
896
887
trip -> temperature = acpi_thermal_temp (tz , crit_temp );
897
888
trip ++ ;
898
889
}
899
890
900
- if (tz -> trips . hot_valid ) {
891
+ if (hot_temp != THERMAL_TEMP_INVALID ) {
901
892
trip -> type = THERMAL_TRIP_HOT ;
902
893
trip -> temperature = acpi_thermal_temp (tz , hot_temp );
903
894
trip ++ ;
0 commit comments