thermal: gov_fair_share: Rearrange get_trip_level()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 12 Oct 2023 18:29:43 +0000 (20:29 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 20 Oct 2023 17:26:37 +0000 (19:26 +0200)
commit276f1ede95164b54f55c82d40e9df218109704d6
tree348aafd1cda16bb5d7211f9d5aa5a0d3acf525e2
parent234ed6f5fbedf7bc84f9adc08c3e11ca8588ffd8
thermal: gov_fair_share: Rearrange get_trip_level()

Make get_trip_level() use for_each_trip() to iterate over trip points
and make it call thermal_zone_trip_id() to obtain the integer ID of a
given trip point so as to avoid relying on the knowledge of struct
thermal_zone_device internals.

The general functionality is not expected to be changed.

This change causes the governor to use trip pointers instead of trip
indices everywhere except for the fair_share_throttle() second argument
that will be modified subsequently along with the definition of the
governor .throttle() callback.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/gov_fair_share.c