diff mbox series

[RFC,2/2] thermal/drivers/qoriq: Use the get_temp_id()

Message ID 20190404080647.8173-2-daniel.lezcano@linaro.org
State New
Headers show
Series [RFC,1/2] thermal/drivers/of: Add a get_temp_id callback function | expand

Commit Message

Daniel Lezcano April 4, 2019, 8:06 a.m. UTC
Currently the code is adding extra back pointer to find out the general
structure for the driver from the sensor data.

Use the get_temp_id() which pass the sensor id when registering the callback.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

---
 drivers/thermal/qoriq_thermal.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.17.1
diff mbox series

Patch

diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
index 3b5f5b3fb1bc..405d1fbdd0cb 100644
--- a/drivers/thermal/qoriq_thermal.c
+++ b/drivers/thermal/qoriq_thermal.c
@@ -92,20 +92,20 @@  static u32 tmu_read(struct qoriq_tmu_data *p, void __iomem *addr)
 		return ioread32be(addr);
 }
 
-static int tmu_get_temp(void *p, int *temp)
+static int tmu_get_temp(int id, void *p, int *temp)
 {
 	struct qoriq_sensor *qsensor = p;
 	struct qoriq_tmu_data *qdata = qsensor->qdata;
 	u32 val;
 
-	val = tmu_read(qdata, &qdata->regs->site[qsensor->id].tritsr);
+	val = tmu_read(qdata, &qdata->regs->site[id].tritsr);
 	*temp = (val & 0xff) * 1000;
 
 	return 0;
 }
 
 static const struct thermal_zone_of_device_ops tmu_tz_ops = {
-	.get_temp = tmu_get_temp,
+	.get_temp_id = tmu_get_temp,
 };
 
 static int qoriq_tmu_register_tmu_zone(struct platform_device *pdev)