1 From 072e35c98806100182c0a7263cf4cba09ce43463 Mon Sep 17 00:00:00 2001
2 From: Daniel Lezcano <daniel.lezcano@linaro.org>
3 Date: Wed, 1 Mar 2023 21:14:38 +0100
4 Subject: [PATCH] thermal/core: Add thermal_zone_device structure 'type'
7 The thermal zone device structure is exposed via the exported
8 thermal.h header. This structure should stay private the thermal core
9 code. In order to encapsulate the structure, let's add an accessor to
10 get the 'type' of the thermal zone.
12 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
13 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
15 drivers/thermal/thermal_core.c | 6 ++++++
16 include/linux/thermal.h | 6 ++++++
17 2 files changed, 12 insertions(+)
19 --- a/drivers/thermal/thermal_core.c
20 +++ b/drivers/thermal/thermal_core.c
21 @@ -1352,6 +1352,12 @@ void *thermal_zone_device_priv(struct th
23 EXPORT_SYMBOL_GPL(thermal_zone_device_priv);
25 +const char *thermal_zone_device_type(struct thermal_zone_device *tzd)
29 +EXPORT_SYMBOL_GPL(thermal_zone_device_type);
32 * thermal_zone_device_unregister - removes the registered thermal zone device
33 * @tz: the thermal zone device to remove
34 --- a/include/linux/thermal.h
35 +++ b/include/linux/thermal.h
36 @@ -347,6 +347,7 @@ thermal_zone_device_register_with_trips(
37 struct thermal_zone_params *, int, int);
39 void *thermal_zone_device_priv(struct thermal_zone_device *tzd);
40 +const char *thermal_zone_device_type(struct thermal_zone_device *tzd);
42 int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
43 struct thermal_cooling_device *,
44 @@ -423,6 +424,11 @@ static inline void *thermal_zone_device_
49 +static inline const char *thermal_zone_device_type(struct thermal_zone_device *tzd)
54 static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)