aboutsummaryrefslogtreecommitdiff
path: root/drivers/thermal/gov_power_allocator.c
diff options
context:
space:
mode:
authorGravatar Rafael J. Wysocki <rafael.j.wysocki@intel.com> 2023-10-12 20:34:50 +0200
committerGravatar Rafael J. Wysocki <rafael.j.wysocki@intel.com> 2023-10-20 19:26:37 +0200
commit8c35b1f472533b0df1b8f1f1afcaf4395cdb2256 (patch)
tree00be096e40c553e3912fbc9ad62190d555b41421 /drivers/thermal/gov_power_allocator.c
parentthermal: gov_step_wise: Fold update_passive_instance() into its caller (diff)
downloadlinux-8c35b1f472533b0df1b8f1f1afcaf4395cdb2256.tar.gz
linux-8c35b1f472533b0df1b8f1f1afcaf4395cdb2256.tar.bz2
linux-8c35b1f472533b0df1b8f1f1afcaf4395cdb2256.zip
thermal: core: Pass trip pointer to governor throttle callback
Modify the governor .throttle() callback definition so that it takes a trip pointer instead of a trip index as its second argument, adjust the governors accordingly and update the core code invoking .throttle(). This causes the governors to become independent of the representation of the list of trips in the thermal zone structure. This change is not expected to alter the general functionality. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/thermal/gov_power_allocator.c')
-rw-r--r--drivers/thermal/gov_power_allocator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index c0d29d286374..83d4f451b1a9 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -676,10 +676,10 @@ static void power_allocator_unbind(struct thermal_zone_device *tz)
tz->governor_data = NULL;
}
-static int power_allocator_throttle(struct thermal_zone_device *tz, int trip_index)
+static int power_allocator_throttle(struct thermal_zone_device *tz,
+ const struct thermal_trip *trip)
{
struct power_allocator_params *params = tz->governor_data;
- const struct thermal_trip *trip = &tz->trips[trip_index];
bool update;
lockdep_assert_held(&tz->lock);