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:   Fri, 16 Jun 2023 16:34:07 +0200
From:   Daniel Lezcano <daniel.lezcano@...aro.org>
To:     zhuyinbo@...ngson.cn
Cc:     rafael@...nel.org, daniel.lezcano@...aro.org,
        loongson-kernel@...ts.loongnix.cn, linux-kernel@...r.kernel.org,
        linux-pm@...r.kernel.org,
        zhanghongchen <zhanghongchen@...ngson.cn>,
        Amit Kucheria <amitk@...nel.org>,
        Zhang Rui <rui.zhang@...el.com>
Subject: [PATCH] thermal/drivers/loongson2: Fix thermal zone private data access

The thermal zone device won't be accessible directly anymore.

Use the private data accessor.

Cc: zhuyinbo <zhuyinbo@...ngson.cn>
Cc: Yinbo Zhu <zhuyinbo@...ngson.cn>
Signed-off-by: Daniel Lezcano <daniel.lezcano@...aro.org>
---
 drivers/thermal/loongson2_thermal.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/loongson2_thermal.c b/drivers/thermal/loongson2_thermal.c
index 6a338e6e490e..9a07409c3bd2 100644
--- a/drivers/thermal/loongson2_thermal.c
+++ b/drivers/thermal/loongson2_thermal.c
@@ -56,7 +56,7 @@ static int loongson2_thermal_set(struct loongson2_thermal_data *data,
 static int loongson2_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
 	u32 reg_val;
-	struct loongson2_thermal_data *data = tz->devdata;
+	struct loongson2_thermal_data *data = thermal_zone_device_priv(tz);
 
 	reg_val = readl(data->regs + LOONGSON2_TSENSOR_OUT);
 	*temp = ((reg_val & 0xff) - 100) * 1000;
@@ -67,7 +67,7 @@ static int loongson2_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 static irqreturn_t loongson2_thermal_irq_thread(int irq, void *dev)
 {
 	struct thermal_zone_device *tzd = dev;
-	struct loongson2_thermal_data *data = tzd->devdata;
+	struct loongson2_thermal_data *data = thermal_zone_device_priv(tzd);
 
 	/* clear interrupt */
 	writeb(0x3, data->regs + LOONGSON2_TSENSOR_STATUS);
@@ -79,7 +79,7 @@ static irqreturn_t loongson2_thermal_irq_thread(int irq, void *dev)
 
 static int loongson2_thermal_set_trips(struct thermal_zone_device *tz, int low, int high)
 {
-	struct loongson2_thermal_data *data = tz->devdata;
+	struct loongson2_thermal_data *data = thermal_zone_device_priv(tz);
 
 	return loongson2_thermal_set(data, low/1000, high/1000, true);
 }
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ