Commit 072e35c9 authored by Daniel Lezcano's avatar Daniel Lezcano Committed by Rafael J. Wysocki

thermal/core: Add thermal_zone_device structure 'type' accessor

The thermal zone device structure is exposed via the exported
thermal.h header. This structure should stay private the thermal core
code. In order to encapsulate the structure, let's add an accessor to
get the 'type' of the thermal zone.
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent dec07d39
...@@ -1383,6 +1383,12 @@ void *thermal_zone_device_priv(struct thermal_zone_device *tzd) ...@@ -1383,6 +1383,12 @@ void *thermal_zone_device_priv(struct thermal_zone_device *tzd)
} }
EXPORT_SYMBOL_GPL(thermal_zone_device_priv); EXPORT_SYMBOL_GPL(thermal_zone_device_priv);
const char *thermal_zone_device_type(struct thermal_zone_device *tzd)
{
return tzd->type;
}
EXPORT_SYMBOL_GPL(thermal_zone_device_type);
/** /**
* thermal_zone_device_unregister - removes the registered thermal zone device * thermal_zone_device_unregister - removes the registered thermal zone device
* @tz: the thermal zone device to remove * @tz: the thermal zone device to remove
......
...@@ -366,6 +366,7 @@ thermal_zone_device_register_with_trips(const char *, struct thermal_trip *, int ...@@ -366,6 +366,7 @@ thermal_zone_device_register_with_trips(const char *, struct thermal_trip *, int
struct thermal_zone_params *, int, int); struct thermal_zone_params *, int, int);
void *thermal_zone_device_priv(struct thermal_zone_device *tzd); void *thermal_zone_device_priv(struct thermal_zone_device *tzd);
const char *thermal_zone_device_type(struct thermal_zone_device *tzd);
int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
struct thermal_cooling_device *, struct thermal_cooling_device *,
...@@ -443,6 +444,11 @@ static inline void *thermal_zone_device_priv(struct thermal_zone_device *tz) ...@@ -443,6 +444,11 @@ static inline void *thermal_zone_device_priv(struct thermal_zone_device *tz)
return NULL; return NULL;
} }
static inline const char *thermal_zone_device_type(struct thermal_zone_device *tzd)
{
return NULL;
}
static inline int thermal_zone_device_enable(struct thermal_zone_device *tz) static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
{ return -ENODEV; } { return -ENODEV; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment