[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240130111250.185718-10-angelogioacchino.delregno@collabora.com>
Date: Tue, 30 Jan 2024 12:12:41 +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 09/18] thermal: intel: quark_dts: 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>
---
.../thermal/intel/intel_quark_dts_thermal.c | 23 +++++++++++--------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/drivers/thermal/intel/intel_quark_dts_thermal.c b/drivers/thermal/intel/intel_quark_dts_thermal.c
index 646ca8bd40a9..381a806d5f62 100644
--- a/drivers/thermal/intel/intel_quark_dts_thermal.c
+++ b/drivers/thermal/intel/intel_quark_dts_thermal.c
@@ -320,10 +320,16 @@ static void free_soc_dts(struct soc_sensor_entry *aux_entry)
static struct soc_sensor_entry *alloc_soc_dts(void)
{
+ struct thermal_zone_device_params tzdp = {
+ .tzp = {
+ .type = "quark_dts",
+ .ops = &tzone_ops,
+ .polling_delay = polling_delay,
+ }
+ };
struct soc_sensor_entry *aux_entry;
int err;
u32 out;
- int wr_mask;
aux_entry = kzalloc(sizeof(*aux_entry), GFP_KERNEL);
if (!aux_entry) {
@@ -339,10 +345,10 @@ static struct soc_sensor_entry *alloc_soc_dts(void)
if (out & QRK_DTS_LOCK_BIT) {
aux_entry->locked = true;
- wr_mask = QRK_DTS_WR_MASK_CLR;
+ tzdp.tzp.mask = QRK_DTS_WR_MASK_CLR;
} else {
aux_entry->locked = false;
- wr_mask = QRK_DTS_WR_MASK_SET;
+ tzdp.tzp.mask = QRK_DTS_WR_MASK_SET;
}
/* Store DTS default state if DTS registers are not locked */
@@ -368,12 +374,11 @@ static struct soc_sensor_entry *alloc_soc_dts(void)
aux_entry->trips[QRK_DTS_ID_TP_HOT].temperature = get_trip_temp(QRK_DTS_ID_TP_HOT);
aux_entry->trips[QRK_DTS_ID_TP_HOT].type = THERMAL_TRIP_HOT;
- aux_entry->tzone = thermal_zone_device_register_with_trips("quark_dts",
- aux_entry->trips,
- QRK_MAX_DTS_TRIPS,
- wr_mask,
- aux_entry, &tzone_ops,
- NULL, 0, polling_delay);
+ tzdp.tzp.devdata = aux_entry;
+ tzdp.tzp.trips = aux_entry->trips;
+ tzdp.tzp.num_trips = QRK_MAX_DTS_TRIPS;
+
+ aux_entry->tzone = thermal_zone_device_register(&tzdp);
if (IS_ERR(aux_entry->tzone)) {
err = PTR_ERR(aux_entry->tzone);
goto err_ret;
--
2.43.0
Powered by blists - more mailing lists