diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2016-03-09 18:40:06 +0530 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2016-03-09 10:31:20 -0800 |
commit | e498b4984db82b4ba3ceea7dba813222a31e9c2e (patch) | |
tree | 5ce061bc5e4c485d6b9aa1a9ce47144fec68e986 /include | |
parent | 3a7fd9c737e2c124d20c351529316d71962cf6ca (diff) | |
download | linux-stable-e498b4984db82b4ba3ceea7dba813222a31e9c2e.tar.gz linux-stable-e498b4984db82b4ba3ceea7dba813222a31e9c2e.tar.bz2 linux-stable-e498b4984db82b4ba3ceea7dba813222a31e9c2e.zip |
thermal: of-thermal: Add devm version of thermal_zone_of_sensor_register
Add resource managed version of thermal_zone_of_sensor_register() and
thermal_zone_of_sensor_unregister().
This helps in reducing the code size in error path, remove of
driver remove callbacks and making proper sequence for deallocations.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/thermal.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index e13a1ace50e9..9c481991fdc7 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -362,6 +362,11 @@ thermal_zone_of_sensor_register(struct device *dev, int id, void *data, const struct thermal_zone_of_device_ops *ops); void thermal_zone_of_sensor_unregister(struct device *dev, struct thermal_zone_device *tz); +struct thermal_zone_device *devm_thermal_zone_of_sensor_register( + struct device *dev, int id, void *data, + const struct thermal_zone_of_device_ops *ops); +void devm_thermal_zone_of_sensor_unregister(struct device *dev, + struct thermal_zone_device *tz); #else static inline struct thermal_zone_device * thermal_zone_of_sensor_register(struct device *dev, int id, void *data, @@ -376,6 +381,19 @@ void thermal_zone_of_sensor_unregister(struct device *dev, { } +static inline struct thermal_zone_device *devm_thermal_zone_of_sensor_register( + struct device *dev, int id, void *data, + const struct thermal_zone_of_device_ops *ops) +{ + return ERR_PTR(-ENODEV); +} + +static inline +void devm_thermal_zone_of_sensor_unregister(struct device *dev, + struct thermal_zone_device *tz) +{ +} + #endif #if IS_ENABLED(CONFIG_THERMAL) |