]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
thermal: core: Initialize thermal zones before registering them
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 4 Oct 2024 19:05:49 +0000 (21:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:50:44 +0000 (19:50 +0100)
commit20c2fe56889b6cc42eca106150868eadb16a8483
treec743d9ee0f526a915c55422e5d545a1f8a313931
parent06de6e9bc8187346987848aa7fec45bc91dff720
thermal: core: Initialize thermal zones before registering them

[ Upstream commit 662f920f7e390db5d1a6792a2b0ffa59b6c962fc ]

Since user space can start interacting with a new thermal zone as soon
as device_register() called by thermal_zone_device_register_with_trips()
returns, it is better to initialize the thermal zone before calling
device_register() on it.

Fixes: d0df264fbd3c ("thermal/core: Remove pointless thermal_zone_device_reset() function")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3336146.44csPzL39Z@rjwysocki.net
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/thermal_core.c