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]
Date: Tue, 30 Jan 2024 12:12:39 +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 07/18] thermal/drivers/st: 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/st/st_thermal.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c
index 0d6249b36609..2f7b22764bd0 100644
--- a/drivers/thermal/st/st_thermal.c
+++ b/drivers/thermal/st/st_thermal.c
@@ -143,9 +143,9 @@ int st_thermal_register(struct platform_device *pdev,
 	struct st_thermal_sensor *sensor;
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
+	struct thermal_zone_device_params tzdp;
 	const struct of_device_id *match;
 
-	int polling_delay;
 	int ret;
 
 	if (!np) {
@@ -197,14 +197,17 @@ int st_thermal_register(struct platform_device *pdev,
 	if (ret)
 		goto sensor_off;
 
-	polling_delay = sensor->ops->register_enable_irq ? 0 : 1000;
-
 	trip.temperature = sensor->cdata->crit_temp;
 	trip.type = THERMAL_TRIP_CRITICAL;
 
-	sensor->thermal_dev =
-		thermal_zone_device_register_with_trips(dev_name(dev), &trip, 1, 0, sensor,
-							&st_tz_ops, NULL, 0, polling_delay);
+	tzdp.tzp.type = dev_name(dev);
+	tzdp.tzp.ops = &st_tz_ops;
+	tzdp.tzp.devdata = sensor;
+	tzdp.tzp.trips = &trip;
+	tzdp.tzp.num_trips = 1;
+	tzdp.tzp.polling_delay = sensor->ops->register_enable_irq ? 0 : 1000;
+
+	sensor->thermal_dev = thermal_zone_device_register(&tzdp);
 	if (IS_ERR(sensor->thermal_dev)) {
 		dev_err(dev, "failed to register thermal zone device\n");
 		ret = PTR_ERR(sensor->thermal_dev);
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ