[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240130111250.185718-14-angelogioacchino.delregno@collabora.com>
Date: Tue, 30 Jan 2024 12:12:45 +0100
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
To: daniel.lezcano@...aro.org
Cc: miquel.raynal@...tlin.com,
rafael@...nel.org,
rui.zhang@...el.com,
lukasz.luba@....com,
support.opensource@...semi.com,
shawnguo@...nel.org,
s.hauer@...gutronix.de,
kernel@...gutronix.de,
festevam@...il.com,
linux-imx@....com,
andersson@...nel.org,
konrad.dybcio@...aro.org,
amitk@...nel.org,
thara.gopinath@...il.com,
niklas.soderlund@...natech.se,
srinivas.pandruvada@...ux.intel.com,
angelogioacchino.delregno@...labora.com,
baolin.wang@...ux.alibaba.com,
u.kleine-koenig@...gutronix.de,
hayashi.kunihiko@...ionext.com,
d-gole@...com,
linus.walleij@...aro.org,
DLG-Adam.Ward.opensource@...renesas.com,
error27@...il.com,
heiko@...ech.de,
hdegoede@...hat.com,
jernej.skrabec@...il.com,
f.fainelli@...il.com,
bchihi@...libre.com,
linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-arm-msm@...r.kernel.org,
linux-renesas-soc@...r.kernel.org,
kernel@...labora.com
Subject: [PATCH v1 13/18] thermal: intel: x86_pkg_temp: Migrate to thermal_zone_device_register()
The thermal API has a new thermal_zone_device_register() function which
is deprecating the older thermal_zone_device_register_with_trips() and
thermal_tripless_zone_device_register().
Migrate to the new thermal zone device registration function.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
---
drivers/thermal/intel/x86_pkg_temp_thermal.c | 22 +++++++++++++-------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c b/drivers/thermal/intel/x86_pkg_temp_thermal.c
index 11a7f8108bbb..0bdc1d1855e2 100644
--- a/drivers/thermal/intel/x86_pkg_temp_thermal.c
+++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c
@@ -57,10 +57,6 @@ struct zone_device {
struct cpumask cpumask;
};
-static struct thermal_zone_params pkg_temp_tz_params = {
- .no_hwmon = true,
-};
-
/* Keep track of how many zone pointers we allocated in init() */
static int max_id __read_mostly;
/* Array of zone pointers */
@@ -312,6 +308,13 @@ static struct thermal_trip *pkg_temp_thermal_trips_init(int cpu, int tj_max, int
static int pkg_temp_thermal_device_add(unsigned int cpu)
{
+ struct thermal_zone_device_params tzdp = {
+ .tzp = {
+ .type = "x86_pkg_temp",
+ .ops = &tzone_ops,
+ .no_hwmon = true,
+ }
+ };
int id = topology_logical_die_id(cpu);
u32 eax, ebx, ecx, edx;
struct zone_device *zonedev;
@@ -344,10 +347,13 @@ static int pkg_temp_thermal_device_add(unsigned int cpu)
INIT_DELAYED_WORK(&zonedev->work, pkg_temp_thermal_threshold_work_fn);
zonedev->cpu = cpu;
- zonedev->tzone = thermal_zone_device_register_with_trips("x86_pkg_temp",
- zonedev->trips, thres_count,
- (thres_count == MAX_NUMBER_OF_TRIPS) ? 0x03 : 0x01,
- zonedev, &tzone_ops, &pkg_temp_tz_params, 0, 0);
+
+ tzdp.tzp.devdata = zonedev;
+ tzdp.tzp.trips = zonedev->trips;
+ tzdp.tzp.num_trips = thres_count;
+ tzdp.tzp.mask = (thres_count == MAX_NUMBER_OF_TRIPS) ? 0x03 : 0x01;
+
+ zonedev->tzone = thermal_zone_device_register(&tzdp);
if (IS_ERR(zonedev->tzone)) {
err = PTR_ERR(zonedev->tzone);
goto out_kfree_trips;
--
2.43.0
Powered by blists - more mailing lists