[PATCH 0/4] thermal/core: Decouple release paths for tz and cdev
From: Daniel Lezcano
Date: Fri May 08 2026 - 14:05:58 EST
This series cleans up the lifetime handling of thermal devices.
Currently, the thermal class release callback handles both thermal
zones and cooling devices by checking the device name prefix. This
approach is fragile and mixes responsibilities across different object
types.
The first two patches introduce dedicated struct device release
callbacks for thermal zones and cooling devices. This removes the need
to rely on device names and keeps the lifetime management local to
each object.
The last two patches convert the thermal class to a dynamically
allocated object and simplify the initialization logic by using the
class pointer itself as a guard instead of a separate boolean flag.
Overall, this results in a clearer separation of responsibilities and
more robust lifetime management aligned with the device model.
No functional change intended.
---
Daniel Lezcano (4):
thermal/core: Add dedicated release callback for cooling devices
thermal/core: Add dedicated release callback for thermal zones
thermal/core: Allocate the thermal class dynamically
thermal/core: Use the thermal class pointer as init guard
drivers/thermal/thermal_core.c | 73 ++++++++++++++++------------------
1 file changed, 35 insertions(+), 38 deletions(-)
--
2.43.0