Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a6cd25b authored by Christophe Jaillet's avatar Christophe Jaillet Committed by Zhang Rui
Browse files

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 32fa5ba3
Loading
Loading
Loading
Loading
+1 −5
Original line number Original line Diff line number Diff line
@@ -836,11 +836,7 @@ static void thermal_release(struct device *dev)
	if (!strncmp(dev_name(dev), "thermal_zone",
	if (!strncmp(dev_name(dev), "thermal_zone",
		     sizeof("thermal_zone") - 1)) {
		     sizeof("thermal_zone") - 1)) {
		tz = to_thermal_zone(dev);
		tz = to_thermal_zone(dev);
		kfree(tz->trip_type_attrs);
		thermal_zone_destroy_device_groups(tz);
		kfree(tz->trip_temp_attrs);
		kfree(tz->trip_hyst_attrs);
		kfree(tz->trips_attribute_group.attrs);
		kfree(tz->device.groups);
		kfree(tz);
		kfree(tz);
	} else if (!strncmp(dev_name(dev), "cooling_device",
	} else if (!strncmp(dev_name(dev), "cooling_device",
			    sizeof("cooling_device") - 1)) {
			    sizeof("cooling_device") - 1)) {