lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231221124825.149141-11-angelogioacchino.delregno@collabora.com>
Date: Thu, 21 Dec 2023 13:48:09 +0100
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
To: daniel.lezcano@...aro.org
Cc: rafael@...nel.org,
	rui.zhang@...el.com,
	lukasz.luba@....com,
	linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	kernel@...labora.com
Subject: [RFC PATCH 10/26] 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   | 21 +++++++++++--------
 1 file changed, 12 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..aba2db87c140 100644
--- a/drivers/thermal/intel/intel_quark_dts_thermal.c
+++ b/drivers/thermal/intel/intel_quark_dts_thermal.c
@@ -320,10 +320,14 @@ 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 = {
+		.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 +343,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.mask = QRK_DTS_WR_MASK_CLR;
 	} else {
 		aux_entry->locked = false;
-		wr_mask = QRK_DTS_WR_MASK_SET;
+		tzdp.mask = QRK_DTS_WR_MASK_SET;
 	}
 
 	/* Store DTS default state if DTS registers are not locked */
@@ -368,12 +372,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.devdata = aux_entry;
+	tzdp.trips = aux_entry->trips;
+	tzdp.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

Powered by Openwall GNU/*/Linux Powered by OpenVZ