[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220710212423.681301-16-daniel.lezcano@linexp.org>
Date: Sun, 10 Jul 2022 23:24:05 +0200
From: Daniel Lezcano <daniel.lezcano@...exp.org>
To: daniel.lezcano@...aro.org, rafael@...nel.org
Cc: rui.zhang@...el.com, khilman@...libre.com, abailon@...libre.com,
amitk@...nel.org, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org
Subject: [PATCH v1 15/33] thermal/drivers/db8500: Switch to new of API
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@...exp.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
Powered by blists - more mailing lists