Skip to content

Commit 5d10f48

Browse files
committed
thermal/of: Remove the thermal_zone_of_get_sensor_id() function
The function thermal_zone_of_get_sensor_id() is no longer used anywhere, remove it. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20220818082316.2717095-2-daniel.lezcano@linaro.org
1 parent 31fd4b9 commit 5d10f48

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

drivers/thermal/thermal_of.c

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -130,50 +130,6 @@ static int of_thermal_get_crit_temp(struct thermal_zone_device *tz,
130130
return -EINVAL;
131131
}
132132

133-
/**
134-
* thermal_zone_of_get_sensor_id - get sensor ID from a DT thermal zone
135-
* @tz_np: a valid thermal zone device node.
136-
* @sensor_np: a sensor node of a valid sensor device.
137-
* @id: the sensor ID returned if success.
138-
*
139-
* This function will get sensor ID from a given thermal zone node and
140-
* the sensor node must match the temperature provider @sensor_np.
141-
*
142-
* Return: 0 on success, proper error code otherwise.
143-
*/
144-
145-
int thermal_zone_of_get_sensor_id(struct device_node *tz_np,
146-
struct device_node *sensor_np,
147-
u32 *id)
148-
{
149-
struct of_phandle_args sensor_specs;
150-
int ret;
151-
152-
ret = of_parse_phandle_with_args(tz_np,
153-
"thermal-sensors",
154-
"#thermal-sensor-cells",
155-
0,
156-
&sensor_specs);
157-
if (ret)
158-
return ret;
159-
160-
if (sensor_specs.np != sensor_np) {
161-
of_node_put(sensor_specs.np);
162-
return -ENODEV;
163-
}
164-
165-
if (sensor_specs.args_count > 1)
166-
pr_warn("%pOFn: too many cells in sensor specifier %d\n",
167-
sensor_specs.np, sensor_specs.args_count);
168-
169-
*id = sensor_specs.args_count ? sensor_specs.args[0] : 0;
170-
171-
of_node_put(sensor_specs.np);
172-
173-
return 0;
174-
}
175-
EXPORT_SYMBOL_GPL(thermal_zone_of_get_sensor_id);
176-
177133
/*** functions parsing device tree nodes ***/
178134

179135
static int of_find_trip_id(struct device_node *np, struct device_node *trip)

include/linux/thermal.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,6 @@ void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zone_dev
308308

309309
void thermal_of_zone_unregister(struct thermal_zone_device *tz);
310310

311-
int thermal_zone_of_get_sensor_id(struct device_node *tz_np,
312-
struct device_node *sensor_np,
313-
u32 *id);
314311
#else
315312
static inline
316313
struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor, int id, void *data,
@@ -334,13 +331,6 @@ static inline void devm_thermal_of_zone_unregister(struct device *dev,
334331
struct thermal_zone_device *tz)
335332
{
336333
}
337-
338-
static inline int thermal_zone_of_get_sensor_id(struct device_node *tz_np,
339-
struct device_node *sensor_np,
340-
u32 *id)
341-
{
342-
return -ENOENT;
343-
}
344334
#endif
345335

346336
#ifdef CONFIG_THERMAL

0 commit comments

Comments
 (0)