drivers/thermal/loongson2_thermal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
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
On 16/06/2023 16:34, Daniel Lezcano wrote:
> The thermal zone device won't be accessible directly anymore.
>
> Use the private data accessor.
To be folded with your next version
Thanks
> 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);
> }
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
在 2023/6/16 下午10:35, Daniel Lezcano 写道: > On 16/06/2023 16:34, Daniel Lezcano wrote: >> The thermal zone device won't be accessible directly anymore. >> >> Use the private data accessor. > > To be folded with your next version > okay, If I understand correctly, I will make this patch as a independent [3/3] patch of the v15 series patch. Thanks, Yinbo
On 17/06/2023 03:52, zhuyinbo wrote: > > > 在 2023/6/16 下午10:35, Daniel Lezcano 写道: >> On 16/06/2023 16:34, Daniel Lezcano wrote: >>> The thermal zone device won't be accessible directly anymore. >>> >>> Use the private data accessor. >> >> To be folded with your next version >> > > > okay, If I understand correctly, I will make this patch as a independent > [3/3] patch of the v15 series patch. It is better to merge it with your patch 2 in order to prevent a git bisecting error (no need to add a my signoff or whatever) -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
在 2023/6/17 下午3:12, Daniel Lezcano 写道: > On 17/06/2023 03:52, zhuyinbo wrote: >> >> >> 在 2023/6/16 下午10:35, Daniel Lezcano 写道: >>> On 16/06/2023 16:34, Daniel Lezcano wrote: >>>> The thermal zone device won't be accessible directly anymore. >>>> >>>> Use the private data accessor. >>> >>> To be folded with your next version >>> >> >> >> okay, If I understand correctly, I will make this patch as a independent >> [3/3] patch of the v15 series patch. > > It is better to merge it with your patch 2 in order to prevent a git > bisecting error (no need to add a my signoff or whatever) okay, I got it. Thanks, Yinbo >
© 2016 - 2026 Red Hat, Inc.