Re: [PATCH v4 08/10] thermal/of: Pass cdev_id and introduce devm registration helper
From: Lukasz Luba
Date: Fri May 29 2026 - 12:08:38 EST
On 5/26/26 15:08, Daniel Lezcano wrote:
Extend the OF cooling device registration to support an explicit
cooling device identifier (cdev_id), preparing for upcoming DT
bindings where cooling devices are identified by a tuple (device node,
id) instead of relying on child nodes.
Introduce a new helper:
devm_thermal_of_cooling_device_register()
which registers a cooling device using the device's of_node and an
explicit cdev_id. This complements the existing
devm_thermal_of_child_cooling_device_register() helper, which
remains dedicated to the legacy child-node based bindings.
Internally, factorize the devm registration logic into a common
helper to avoid code duplication.
Existing users are unaffected, as the child-based helper continues
to pass a default cdev_id of 0, preserving current behavior.
This change is a preparatory step for supporting indexed cooling
devices in thermal OF bindings.
Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxxxxxxxx>
---
drivers/thermal/thermal_of.c | 58 ++++++++++++++++++++++++++++--------
include/linux/thermal.h | 13 ++++++++
2 files changed, 59 insertions(+), 12 deletions(-)
Reviewed-by: Lukasz Luba <lukasz.luba@xxxxxxx>