summaryrefslogtreecommitdiffstats
path: root/include/linux/thermal.h
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2023-03-01 21:14:29 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-03-03 20:45:02 +0100
commita6ff3c0021468721b96e84892a8cae24bde8d65f (patch)
tree2a640cca042cde3397833dab19851688f2d90b7c /include/linux/thermal.h
parent0a3f9a6b0265b64c02226fcabb5e9a958307913b (diff)
downloadlinux-a6ff3c0021468721b96e84892a8cae24bde8d65f.tar.gz
linux-a6ff3c0021468721b96e84892a8cae24bde8d65f.tar.bz2
linux-a6ff3c0021468721b96e84892a8cae24bde8d65f.zip
thermal/core: Add a thermal zone 'devdata' accessor
The thermal zone device structure is exposed to the different drivers and obviously they access the internals while that should be restricted to the core thermal code. In order to self-encapsulate the thermal core code, we need to prevent the drivers accessing directly the thermal zone structure and provide accessor functions to deal with. Provide an accessor to the 'devdata' structure and make use of it in the different drivers. No functional changes intended. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r--include/linux/thermal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 2bb4bf33f4f3..7dbb5712434c 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -365,6 +365,8 @@ thermal_zone_device_register_with_trips(const char *, struct thermal_trip *, int
void *, struct thermal_zone_device_ops *,
struct thermal_zone_params *, int, int);
+void *thermal_zone_device_priv(struct thermal_zone_device *tzd);
+
int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
struct thermal_cooling_device *,
unsigned long, unsigned long,
@@ -436,6 +438,11 @@ static inline int thermal_zone_get_offset(
struct thermal_zone_device *tz)
{ return -ENODEV; }
+static inline void *thermal_zone_device_priv(struct thermal_zone_device *tz)
+{
+ return NULL;
+}
+
static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
{ return -ENODEV; }