Skip to content

Commit ad662b1

Browse files
Daniel Lezcanodlezcano
authored andcommitted
Input: sun4i-ts - switch to new of thermal API
The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Acked-by: Jernej Skrabec <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent de15b84 commit ad662b1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/input/touchscreen/sun4i-ts.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,12 @@ static int sun4i_get_temp(const struct sun4i_ts_data *ts, int *temp)
192192
return 0;
193193
}
194194

195-
static int sun4i_get_tz_temp(void *data, int *temp)
195+
static int sun4i_get_tz_temp(struct thermal_zone_device *tz, int *temp)
196196
{
197-
return sun4i_get_temp(data, temp);
197+
return sun4i_get_temp(tz->devdata, temp);
198198
}
199199

200-
static const struct thermal_zone_of_device_ops sun4i_ts_tz_ops = {
200+
static const struct thermal_zone_device_ops sun4i_ts_tz_ops = {
201201
.get_temp = sun4i_get_tz_temp,
202202
};
203203

@@ -356,8 +356,8 @@ static int sun4i_ts_probe(struct platform_device *pdev)
356356
if (IS_ERR(hwmon))
357357
return PTR_ERR(hwmon);
358358

359-
thermal = devm_thermal_zone_of_sensor_register(ts->dev, 0, ts,
360-
&sun4i_ts_tz_ops);
359+
thermal = devm_thermal_of_zone_register(ts->dev, 0, ts,
360+
&sun4i_ts_tz_ops);
361361
if (IS_ERR(thermal))
362362
return PTR_ERR(thermal);
363363

0 commit comments

Comments
 (0)