@@ -429,14 +429,6 @@ static void move_trip_to_sorted_list(struct thermal_trip_desc *td,
429
429
list_add (& td -> list_node , list );
430
430
}
431
431
432
- static void thermal_zone_device_check (struct work_struct * work )
433
- {
434
- struct thermal_zone_device * tz = container_of (work , struct
435
- thermal_zone_device ,
436
- poll_queue .work );
437
- thermal_zone_device_update (tz , THERMAL_EVENT_UNSPECIFIED );
438
- }
439
-
440
432
static void move_to_trips_high (struct thermal_zone_device * tz ,
441
433
struct thermal_trip_desc * td )
442
434
{
@@ -458,39 +450,6 @@ static void move_to_trips_invalid(struct thermal_zone_device *tz,
458
450
list_move (& td -> list_node , & tz -> trips_invalid );
459
451
}
460
452
461
- static void thermal_zone_device_init (struct thermal_zone_device * tz )
462
- {
463
- struct thermal_trip_desc * td , * next ;
464
-
465
- INIT_DELAYED_WORK (& tz -> poll_queue , thermal_zone_device_check );
466
-
467
- tz -> temperature = THERMAL_TEMP_INIT ;
468
- tz -> passive = 0 ;
469
- tz -> prev_low_trip = - INT_MAX ;
470
- tz -> prev_high_trip = INT_MAX ;
471
- for_each_trip_desc (tz , td ) {
472
- struct thermal_instance * instance ;
473
-
474
- list_for_each_entry (instance , & td -> thermal_instances , trip_node )
475
- instance -> initialized = false;
476
- }
477
- /*
478
- * At this point, all valid trips need to be moved to trips_high so that
479
- * mitigation can be started if the zone temperature is above them.
480
- */
481
- list_for_each_entry_safe (td , next , & tz -> trips_invalid , list_node ) {
482
- if (td -> trip .temperature != THERMAL_TEMP_INVALID )
483
- move_to_trips_high (tz , td );
484
- }
485
- /* The trips_reached list may not be empty during system resume. */
486
- list_for_each_entry_safe (td , next , & tz -> trips_reached , list_node ) {
487
- if (td -> trip .temperature == THERMAL_TEMP_INVALID )
488
- move_to_trips_invalid (tz , td );
489
- else
490
- move_to_trips_high (tz , td );
491
- }
492
- }
493
-
494
453
static void thermal_governor_trip_crossed (struct thermal_governor * governor ,
495
454
struct thermal_zone_device * tz ,
496
455
const struct thermal_trip * trip ,
@@ -1426,6 +1385,47 @@ int thermal_zone_get_crit_temp(struct thermal_zone_device *tz, int *temp)
1426
1385
}
1427
1386
EXPORT_SYMBOL_GPL (thermal_zone_get_crit_temp );
1428
1387
1388
+ static void thermal_zone_device_check (struct work_struct * work )
1389
+ {
1390
+ struct thermal_zone_device * tz = container_of (work , struct
1391
+ thermal_zone_device ,
1392
+ poll_queue .work );
1393
+ thermal_zone_device_update (tz , THERMAL_EVENT_UNSPECIFIED );
1394
+ }
1395
+
1396
+ static void thermal_zone_device_init (struct thermal_zone_device * tz )
1397
+ {
1398
+ struct thermal_trip_desc * td , * next ;
1399
+
1400
+ INIT_DELAYED_WORK (& tz -> poll_queue , thermal_zone_device_check );
1401
+
1402
+ tz -> temperature = THERMAL_TEMP_INIT ;
1403
+ tz -> passive = 0 ;
1404
+ tz -> prev_low_trip = - INT_MAX ;
1405
+ tz -> prev_high_trip = INT_MAX ;
1406
+ for_each_trip_desc (tz , td ) {
1407
+ struct thermal_instance * instance ;
1408
+
1409
+ list_for_each_entry (instance , & td -> thermal_instances , trip_node )
1410
+ instance -> initialized = false;
1411
+ }
1412
+ /*
1413
+ * At this point, all valid trips need to be moved to trips_high so that
1414
+ * mitigation can be started if the zone temperature is above them.
1415
+ */
1416
+ list_for_each_entry_safe (td , next , & tz -> trips_invalid , list_node ) {
1417
+ if (td -> trip .temperature != THERMAL_TEMP_INVALID )
1418
+ move_to_trips_high (tz , td );
1419
+ }
1420
+ /* The trips_reached list may not be empty during system resume. */
1421
+ list_for_each_entry_safe (td , next , & tz -> trips_reached , list_node ) {
1422
+ if (td -> trip .temperature == THERMAL_TEMP_INVALID )
1423
+ move_to_trips_invalid (tz , td );
1424
+ else
1425
+ move_to_trips_high (tz , td );
1426
+ }
1427
+ }
1428
+
1429
1429
static int thermal_zone_init_governor (struct thermal_zone_device * tz )
1430
1430
{
1431
1431
struct thermal_governor * governor ;
0 commit comments