]> www.infradead.org Git - users/jedix/linux-maple.git/commit
thermal: core: Update thermal zones after cooling device binding
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 4 Oct 2024 19:33:28 +0000 (21:33 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 22 Oct 2024 10:07:47 +0000 (12:07 +0200)
commitc4cd42ebd32b57841a0dba4b296692d201802618
tree2156b14c0efbc2acf5e647cfa7c3db88cb1b7ec6
parentfa4f9c967969cb04f9a37d567ecd9e1db9e9098f
thermal: core: Update thermal zones after cooling device binding

If a new cooling device is registered and it is bound to at least one
trip point in a given thermal zone, that thermal zone needs to be
updated via __thermal_zone_device_update().

Instead of doing this with the help of the need_update atomic field in
struct thermal_zone_device, which is not particularly straightforward,
make __thermal_zone_cdev_bind() return a bool value indicating whether
or not the given thermal zone needs to be updated because a new cooling
device has been bound to it and update thermal_zone_cdev_bind() to
call __thermal_zone_device_update() when this value is "true".

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/2226302.Icojqenx9y@rjwysocki.net
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
drivers/thermal/thermal_core.c