summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-01-30 21:58:32 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-02-02 17:40:39 +0300
commit2cee73568e8d2f9d63793cf84e9aa65c9dfd85e2 (patch)
tree3e23e8ae8ee71e69e5f466e4df7df7bd5d52800a /drivers/thermal
parent1bcebcab887ba4c4d790d7ccb055303c5dc7dbbb (diff)
downloadlinux-2cee73568e8d2f9d63793cf84e9aa65c9dfd85e2.tar.xz
thermal: intel: intel_pch: Make pch_wpt_add_acpi_psv_trip() return int
Modify pch_wpt_add_acpi_psv_trip() to return an int value instead of using a return pointer for that. While at it, drop an excessive empty code line. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Tested-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/intel/intel_pch_thermal.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c
index c529c05c1853..e5ce4d03c3c1 100644
--- a/drivers/thermal/intel/intel_pch_thermal.c
+++ b/drivers/thermal/intel/intel_pch_thermal.c
@@ -90,34 +90,31 @@ struct pch_thermal_device {
};
#ifdef CONFIG_ACPI
-
/*
* On some platforms, there is a companion ACPI device, which adds
* passive trip temperature using _PSV method. There is no specific
* passive temperature setting in MMIO interface of this PCI device.
*/
-static void pch_wpt_add_acpi_psv_trip(struct pch_thermal_device *ptd,
- int *nr_trips)
+static int pch_wpt_add_acpi_psv_trip(struct pch_thermal_device *ptd, int trip)
{
struct acpi_device *adev;
int temp;
adev = ACPI_COMPANION(&ptd->pdev->dev);
if (!adev)
- return;
+ return 0;
if (thermal_acpi_passive_trip_temp(adev, &temp) || temp <= 0)
- return;
+ return 0;
- ptd->trips[*nr_trips].type = THERMAL_TRIP_PASSIVE;
- ptd->trips[*nr_trips].temperature = temp;
- ++(*nr_trips);
+ ptd->trips[trip].type = THERMAL_TRIP_PASSIVE;
+ ptd->trips[trip].temperature = temp;
+ return 1;
}
#else
-static void pch_wpt_add_acpi_psv_trip(struct pch_thermal_device *ptd,
- int *nr_trips)
+static int pch_wpt_add_acpi_psv_trip(struct pch_thermal_device *ptd, int trip)
{
-
+ return 0;
}
#endif
@@ -167,7 +164,7 @@ read_trips:
++(*nr_trips);
}
- pch_wpt_add_acpi_psv_trip(ptd, nr_trips);
+ *nr_trips += pch_wpt_add_acpi_psv_trip(ptd, *nr_trips);
return 0;
}