lkml.org 
[lkml]   [2022]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 15/33] thermal/drivers/db8500: Switch to new of API
Date
The thermal OF code has a new API allowing to migrate the OF
initialization to a simpler approach.

Use this new API.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linexp.org>
---
drivers/thermal/db8500_thermal.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c
index 21d4d6e6409a..f06492824e27 100644
--- a/drivers/thermal/db8500_thermal.c
+++ b/drivers/thermal/db8500_thermal.c
@@ -59,9 +59,9 @@ struct db8500_thermal_zone {
};

/* Callback to get current temperature */
-static int db8500_thermal_get_temp(void *data, int *temp)
+static int db8500_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
{
- struct db8500_thermal_zone *th = data;
+ struct db8500_thermal_zone *th = tz->devdata;

/*
* TODO: There is no PRCMU interface to get temperature data currently,
@@ -74,16 +74,16 @@ static int db8500_thermal_get_temp(void *data, int *temp)
}

/* Callback to get temperature changing trend */
-static int db8500_thermal_get_trend(void *data, int trip, enum thermal_trend *trend)
+static int db8500_thermal_get_trend(struct thermal_zone_device *tz, int trip, enum thermal_trend *trend)
{
- struct db8500_thermal_zone *th = data;
+ struct db8500_thermal_zone *th = tz->devdata;

*trend = th->trend;

return 0;
}

-static struct thermal_zone_of_device_ops thdev_ops = {
+static struct thermal_zone_device_ops thdev_ops = {
.get_temp = db8500_thermal_get_temp,
.get_trend = db8500_thermal_get_trend,
};
@@ -202,7 +202,7 @@ static int db8500_thermal_probe(struct platform_device *pdev)
}

/* register of thermal sensor and get info from DT */
- th->tz = devm_thermal_zone_of_sensor_register(dev, 0, th, &thdev_ops);
+ th->tz = devm_thermal_of_zone_register(dev, 0, th, &thdev_ops);
if (IS_ERR(th->tz)) {
dev_err(dev, "register thermal zone sensor failed\n");
return PTR_ERR(th->tz);
--
2.25.1
\
 
 \ /
  Last update: 2022-07-10 23:27    [W:0.260 / U:3.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site