summaryrefslogtreecommitdiffstats
path: root/drivers/thermal
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2017-08-08 16:39:53 +0200
committerZhang Rui <rui.zhang@intel.com>2017-08-11 05:34:00 +0200
commit6a6cd25b58dc8ce2fbded8dd83bfa7d48f06f97d (patch)
treee227dd85bc298c807e956540a1d468f9c3bfaf0d /drivers/thermal
parentthermal: core: Add some new helper functions to free resources (diff)
downloadlinux-6a6cd25b58dc8ce2fbded8dd83bfa7d48f06f97d.tar.xz
linux-6a6cd25b58dc8ce2fbded8dd83bfa7d48f06f97d.zip
thermal: core: Use the new 'thermal_zone_destroy_device_groups()' helper function
Simplify code by using the new 'thermal_zone_destroy_device_groups()' helper function. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/thermal_core.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 671e4d15599d..0240c44e858e 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -836,11 +836,7 @@ static void thermal_release(struct device *dev)
if (!strncmp(dev_name(dev), "thermal_zone",
sizeof("thermal_zone") - 1)) {
tz = to_thermal_zone(dev);
- kfree(tz->trip_type_attrs);
- kfree(tz->trip_temp_attrs);
- kfree(tz->trip_hyst_attrs);
- kfree(tz->trips_attribute_group.attrs);
- kfree(tz->device.groups);
+ thermal_zone_destroy_device_groups(tz);
kfree(tz);
} else if (!strncmp(dev_name(dev), "cooling_device",
sizeof("cooling_device") - 1)) {