Skip to content

Commit ac614a9

Browse files
committed
thermal/of: Unexport unused OF functions
The functions thermal_of_zone_register() and thermal_of_zone_unregister() are no longer needed from the drivers as the devm_ variant is always used. Make them static in the C file and remove their declaration from thermal.h Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20230404075138.2914680-2-daniel.lezcano@linaro.org
1 parent 8454c8c commit ac614a9

2 files changed

Lines changed: 3 additions & 22 deletions

File tree

drivers/thermal/thermal_of.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ static int thermal_of_unbind(struct thermal_zone_device *tz,
439439
*
440440
* @tz: a pointer to the thermal zone structure
441441
*/
442-
void thermal_of_zone_unregister(struct thermal_zone_device *tz)
442+
static void thermal_of_zone_unregister(struct thermal_zone_device *tz)
443443
{
444444
struct thermal_trip *trips = tz->trips;
445445
struct thermal_zone_params *tzp = tz->tzp;
@@ -451,7 +451,6 @@ void thermal_of_zone_unregister(struct thermal_zone_device *tz)
451451
kfree(tzp);
452452
kfree(ops);
453453
}
454-
EXPORT_SYMBOL_GPL(thermal_of_zone_unregister);
455454

456455
/**
457456
* thermal_of_zone_register - Register a thermal zone with device node
@@ -473,8 +472,8 @@ EXPORT_SYMBOL_GPL(thermal_of_zone_unregister);
473472
* - ENOMEM: if one structure can not be allocated
474473
* - Other negative errors are returned by the underlying called functions
475474
*/
476-
struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor, int id, void *data,
477-
const struct thermal_zone_device_ops *ops)
475+
static struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor, int id, void *data,
476+
const struct thermal_zone_device_ops *ops)
478477
{
479478
struct thermal_zone_device *tz;
480479
struct thermal_trip *trips;
@@ -550,7 +549,6 @@ struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor,
550549

551550
return ERR_PTR(ret);
552551
}
553-
EXPORT_SYMBOL_GPL(thermal_of_zone_register);
554552

555553
static void devm_thermal_of_zone_release(struct device *dev, void *res)
556554
{

include/linux/thermal.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -259,25 +259,12 @@ struct thermal_zone_params {
259259

260260
/* Function declarations */
261261
#ifdef CONFIG_THERMAL_OF
262-
struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor, int id, void *data,
263-
const struct thermal_zone_device_ops *ops);
264-
265262
struct thermal_zone_device *devm_thermal_of_zone_register(struct device *dev, int id, void *data,
266263
const struct thermal_zone_device_ops *ops);
267264

268-
void thermal_of_zone_unregister(struct thermal_zone_device *tz);
269-
270265
void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zone_device *tz);
271266

272-
void thermal_of_zone_unregister(struct thermal_zone_device *tz);
273-
274267
#else
275-
static inline
276-
struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor, int id, void *data,
277-
const struct thermal_zone_device_ops *ops)
278-
{
279-
return ERR_PTR(-ENOTSUPP);
280-
}
281268

282269
static inline
283270
struct thermal_zone_device *devm_thermal_of_zone_register(struct device *dev, int id, void *data,
@@ -286,10 +273,6 @@ struct thermal_zone_device *devm_thermal_of_zone_register(struct device *dev, in
286273
return ERR_PTR(-ENOTSUPP);
287274
}
288275

289-
static inline void thermal_of_zone_unregister(struct thermal_zone_device *tz)
290-
{
291-
}
292-
293276
static inline void devm_thermal_of_zone_unregister(struct device *dev,
294277
struct thermal_zone_device *tz)
295278
{

0 commit comments

Comments
 (0)