diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-10-12 20:34:50 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-10-20 19:26:37 +0200 |
commit | 8c35b1f472533b0df1b8f1f1afcaf4395cdb2256 (patch) | |
tree | 00be096e40c553e3912fbc9ad62190d555b41421 /drivers/thermal/gov_power_allocator.c | |
parent | fdcf70ed4e1606cd5a5a48f666583053ae4c3978 (diff) | |
download | linux-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.c | 4 |
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); |