Commit a95a9e30 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Greg Kroah-Hartman
Browse files

thermal: core: Make thermal_zone_device_unregister() return after freeing the zone



[ Upstream commit 4649620d ]

Make thermal_zone_device_unregister() wait until all of the references
to the given thermal zone object have been dropped and free it before
returning.

This guarantees that when thermal_zone_device_unregister() returns,
there is no leftover activity regarding the thermal zone in question
which is required by some of its callers (for instance, modular driver
code that wants to know when it is safe to let the module go away).

Subsequently, this will allow some confusing device_is_registered()
checks to be dropped from the thermal sysfs and core code.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-and-tested-by: default avatarLukasz Luba <lukasz.luba@arm.com>
Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Stable-dep-of: 827a0752 ("thermal: core: Free tzp copy along with the thermal zone")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent bf3af7e9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment