Re: [PATCH 0/4] thermal/core: Decouple release paths for tz and cdev

From: Daniel Lezcano

Date: Wed May 13 2026 - 10:29:16 EST



Hi Rafael,

On 5/8/26 20:10, Daniel Lezcano wrote:
On 5/8/26 20:05, Daniel Lezcano wrote:
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.
Unless I’m mistaken, the patch sent to split the cooling device registration is correct with this cleanup.

Were you able to apply the patch splitting the cooling device registration on top of this series ?