[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240130111250.185718-13-angelogioacchino.delregno@collabora.com>
Date: Tue, 30 Jan 2024 12:12:44 +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 12/18] thermal: int340x: processor: 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>
---
.../processor_thermal_device_pci.c | 26 ++++++++++++-------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
index d7495571dd5d..3170eab57e32 100644
--- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
+++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
@@ -242,13 +242,19 @@ static struct thermal_zone_device_ops tzone_ops = {
.set_trip_temp = sys_set_trip_temp,
};
-static struct thermal_zone_params tzone_params = {
- .governor_name = "user_space",
- .no_hwmon = true,
-};
-
static int proc_thermal_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
+ struct thermal_zone_device_params tzdp = {
+ .tzp = {
+ .type = "TCPU_PCI",
+ .mask = 1,
+ .no_hwmon = true,
+ .ops = &tzone_ops,
+ },
+ };
+ struct thermal_governor_params tgp = {
+ .governor_name = "user_space"
+ };
struct proc_thermal_device *proc_priv;
struct proc_thermal_pci *pci_info;
int irq_flag = 0, irq, ret;
@@ -289,10 +295,12 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev, const struct pci_device_
psv_trip.temperature = get_trip_temp(pci_info);
- pci_info->tzone = thermal_zone_device_register_with_trips("TCPU_PCI", &psv_trip,
- 1, 1, pci_info,
- &tzone_ops,
- &tzone_params, 0, 0);
+ tzdp.tzp.devdata = pci_info;
+ tzdp.tzp.trips = &psv_trip;
+ tzdp.tzp.num_trips = 1;
+ tzdp.tgp = &tgp;
+
+ pci_info->tzone = thermal_zone_device_register(&tzdp);
if (IS_ERR(pci_info->tzone)) {
ret = PTR_ERR(pci_info->tzone);
goto err_del_legacy;
--
2.43.0
Powered by blists - more mailing lists