Skip to content

Commit db0a46b

Browse files
committed
thermal: core: Pass trip descriptor to thermal_trip_crossed()
In preparation for subsequent changes, modify thermal_trip_crossed() to take a trip descriptor pointer instead of a pointer to struct thermal_trip and propagate this change to thermal_zone_trip_down(). No functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Lukasz Luba <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent e254ec2 commit db0a46b

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

drivers/thermal/thermal_core.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,12 @@ static void thermal_governor_trip_crossed(struct thermal_governor *governor,
526526
}
527527

528528
static void thermal_trip_crossed(struct thermal_zone_device *tz,
529-
const struct thermal_trip *trip,
529+
struct thermal_trip_desc *td,
530530
struct thermal_governor *governor,
531531
bool crossed_up)
532532
{
533+
const struct thermal_trip *trip = &td->trip;
534+
533535
if (crossed_up) {
534536
thermal_notify_tz_trip_up(tz, trip);
535537
thermal_debug_tz_trip_up(tz, trip);
@@ -589,12 +591,12 @@ void __thermal_zone_device_update(struct thermal_zone_device *tz,
589591
}
590592

591593
list_for_each_entry_safe(td, next, &way_up_list, list_node) {
592-
thermal_trip_crossed(tz, &td->trip, governor, true);
594+
thermal_trip_crossed(tz, td, governor, true);
593595
list_del_init(&td->list_node);
594596
}
595597

596598
list_for_each_entry_safe_reverse(td, next, &way_down_list, list_node) {
597-
thermal_trip_crossed(tz, &td->trip, governor, false);
599+
thermal_trip_crossed(tz, td, governor, false);
598600
list_del_init(&td->list_node);
599601
}
600602

@@ -664,9 +666,9 @@ void thermal_zone_device_update(struct thermal_zone_device *tz,
664666
EXPORT_SYMBOL_GPL(thermal_zone_device_update);
665667

666668
void thermal_zone_trip_down(struct thermal_zone_device *tz,
667-
const struct thermal_trip *trip)
669+
struct thermal_trip_desc *td)
668670
{
669-
thermal_trip_crossed(tz, trip, thermal_get_tz_governor(tz), false);
671+
thermal_trip_crossed(tz, td, thermal_get_tz_governor(tz), false);
670672
}
671673

672674
int for_each_thermal_governor(int (*cb)(struct thermal_governor *, void *),

drivers/thermal/thermal_core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ int thermal_zone_trip_id(const struct thermal_zone_device *tz,
274274
const struct thermal_trip *trip);
275275
int __thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
276276
void thermal_zone_trip_down(struct thermal_zone_device *tz,
277-
const struct thermal_trip *trip);
277+
struct thermal_trip_desc *td);
278278
void thermal_zone_set_trip_hyst(struct thermal_zone_device *tz,
279279
struct thermal_trip *trip, int hyst);
280280

drivers/thermal/thermal_trip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void thermal_zone_set_trip_temp(struct thermal_zone_device *tz,
118118
tz->passive--;
119119
WARN_ON_ONCE(tz->passive < 0);
120120
}
121-
thermal_zone_trip_down(tz, trip);
121+
thermal_zone_trip_down(tz, td);
122122
}
123123
/*
124124
* Invalidate the threshold to avoid triggering a spurious

0 commit comments

Comments
 (0)