Skip to content

Commit 6a6cd25

Browse files
tititiou36zhang-rui
authored andcommitted
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 <[email protected]> Signed-off-by: Zhang Rui <[email protected]>
1 parent 32fa5ba commit 6a6cd25

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/thermal/thermal_core.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -836,11 +836,7 @@ static void thermal_release(struct device *dev)
836836
if (!strncmp(dev_name(dev), "thermal_zone",
837837
sizeof("thermal_zone") - 1)) {
838838
tz = to_thermal_zone(dev);
839-
kfree(tz->trip_type_attrs);
840-
kfree(tz->trip_temp_attrs);
841-
kfree(tz->trip_hyst_attrs);
842-
kfree(tz->trips_attribute_group.attrs);
843-
kfree(tz->device.groups);
839+
thermal_zone_destroy_device_groups(tz);
844840
kfree(tz);
845841
} else if (!strncmp(dev_name(dev), "cooling_device",
846842
sizeof("cooling_device") - 1)) {

0 commit comments

Comments
 (0)