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-4-angelogioacchino.delregno@collabora.com>
Date: Thu, 21 Dec 2023 13:48:02 +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 03/26] platform/x86: acerhdf: 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/platform/x86/acerhdf.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index 74bcb3d13104..f7c1710f736c 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -267,14 +267,6 @@ static const struct bios_settings bios_tbl[] __initconst = {
 	{"", "", "", 0, 0, {0, 0}, 0}
 };
 
-/*
- * this struct is used to instruct thermal layer to use bang_bang instead of
- * default governor for acerhdf
- */
-static struct thermal_zone_params acerhdf_zone_params = {
-	.governor_name = "bang_bang",
-};
-
 static int acerhdf_get_temp(int *temp)
 {
 	u8 read_temp;
@@ -669,6 +661,18 @@ static void acerhdf_unregister_platform(void)
 
 static int __init acerhdf_register_thermal(void)
 {
+	struct thermal_zone_device_params tzdp = {
+		.type = "acerhdf",
+		/*
+		 * this struct is used to instruct thermal layer to use
+		 * bang_bang instead of default governor for acerhdf
+		 */
+		.tzp = { .governor_name = "bang_bang" },
+		.ops = &acerhdf_dev_ops,
+		.trips = trips,
+		.num_trips = ARRAY_SIZE(trips),
+		.polling_delay = kernelmode ? interval * 1000 : 0,
+	};
 	int ret;
 
 	cl_dev = thermal_cooling_device_register("acerhdf-fan", NULL,
@@ -677,10 +681,7 @@ static int __init acerhdf_register_thermal(void)
 	if (IS_ERR(cl_dev))
 		return -EINVAL;
 
-	thz_dev = thermal_zone_device_register_with_trips("acerhdf", trips, ARRAY_SIZE(trips),
-							  0, NULL, &acerhdf_dev_ops,
-							  &acerhdf_zone_params, 0,
-							  (kernelmode) ? interval*1000 : 0);
+	thz_dev = thermal_zone_device_register(&tzdp);
 	if (IS_ERR(thz_dev))
 		return -EINVAL;
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ