All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: zhuyinbo@loongson.cn
Cc: rafael@kernel.org, daniel.lezcano@linaro.org,
	loongson-kernel@lists.loongnix.cn, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org,
	zhanghongchen <zhanghongchen@loongson.cn>,
	Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>
Subject: [PATCH] thermal/drivers/loongson2: Fix thermal zone private data access
Date: Fri, 16 Jun 2023 16:34:07 +0200	[thread overview]
Message-ID: <20230616143407.689515-1-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <8ca44091-35fd-cc24-9896-0317772c5620@loongson.cn>

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

Use the private data accessor.

Cc: zhuyinbo <zhuyinbo@loongson.cn>
Cc: Yinbo Zhu <zhuyinbo@loongson.cn>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.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


  reply	other threads:[~2023-06-16 14:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26  6:20 [PATCH v14 1/2] thermal: loongson-2: add thermal management support Yinbo Zhu
2023-04-26  6:20 ` [PATCH v14 2/2] dt-bindings: thermal: add loongson-2 thermal Yinbo Zhu
2023-06-09  9:22 ` [PATCH v14 1/2] thermal: loongson-2: add thermal management support zhuyinbo
2023-06-12 14:22 ` Daniel Lezcano
2023-06-14  8:03   ` zhuyinbo
2023-06-14 10:59     ` Daniel Lezcano
2023-06-15  2:57       ` zhuyinbo
2023-06-16 14:34         ` Daniel Lezcano [this message]
2023-06-16 14:35           ` [PATCH] thermal/drivers/loongson2: Fix thermal zone private data access Daniel Lezcano
2023-06-17  1:52             ` zhuyinbo
2023-06-17  7:12               ` Daniel Lezcano
2023-06-17  7:23                 ` zhuyinbo
2023-06-17  3:25   ` [PATCH v14 1/2] thermal: loongson-2: add thermal management support zhuyinbo
2023-06-17  7:15     ` Daniel Lezcano
2023-06-17  7:25       ` zhuyinbo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230616143407.689515-1-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=amitk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=loongson-kernel@lists.loongnix.cn \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=zhanghongchen@loongson.cn \
    --cc=zhuyinbo@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.