diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-01-27 21:17:03 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-02-02 17:26:45 +0300 |
commit | dd3b3d160ea7004091051da60e86f36f40970888 (patch) | |
tree | 43a6e5c08142b92c016561fa59839d66e2013234 /drivers/thermal/intel/intel_pch_thermal.c | |
parent | f4118dbe61bb30038ca7f3ecaf333cabc9c54141 (diff) | |
download | linux-dd3b3d160ea7004091051da60e86f36f40970888.tar.xz |
thermal: ACPI: Make helpers retrieve temperature only
It is slightly better to make the ACPI thermal helper functions retrieve
the trip point temperature only instead of doing the full trip point
initialization, because they are also used for updating some already
registered trip points, in which case initializing a new trip just
in order to update the temperature of an existing one is somewhat
wasteful.
Modify the ACPI thermal helpers accordingly and update their users.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/thermal/intel/intel_pch_thermal.c')
-rw-r--r-- | drivers/thermal/intel/intel_pch_thermal.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c index 45a9ea86907e..c529c05c1853 100644 --- a/drivers/thermal/intel/intel_pch_thermal.c +++ b/drivers/thermal/intel/intel_pch_thermal.c @@ -100,16 +100,17 @@ static void pch_wpt_add_acpi_psv_trip(struct pch_thermal_device *ptd, int *nr_trips) { struct acpi_device *adev; - int ret; + int temp; adev = ACPI_COMPANION(&ptd->pdev->dev); if (!adev) return; - ret = thermal_acpi_trip_passive(adev, &ptd->trips[*nr_trips]); - if (ret || ptd->trips[*nr_trips].temperature <= 0) + if (thermal_acpi_passive_trip_temp(adev, &temp) || temp <= 0) return; + ptd->trips[*nr_trips].type = THERMAL_TRIP_PASSIVE; + ptd->trips[*nr_trips].temperature = temp; ++(*nr_trips); } #else |