thermal: intel: Adjust ops handling during thermal zone registration
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 5 Feb 2024 21:20:32 +0000 (22:20 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 23 Feb 2024 17:24:48 +0000 (18:24 +0100)
commit62dd17846d33e75e623965e281e246dff0e01309
tree18186918cd8431f34e50964a91de25911d2b1251
parent75fb8714728460c4584c72e2f6410944a0b2cc44
thermal: intel: Adjust ops handling during thermal zone registration

Because thermal zone operations are now stored directly in struct
thermal_zone_device, thermal zone creators can discard the operations
structure after the zone registration is complete, or it can be made
read-only.

Accordingly, make int340x_thermal_zone_add() use a local variable to
represent thermal zone operations, so it is freed automatically upon the
function exit, and make the other Intel thermal drivers use const zone
operations structures.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
drivers/thermal/intel/intel_pch_thermal.c
drivers/thermal/intel/intel_quark_dts_thermal.c
drivers/thermal/intel/intel_soc_dts_iosf.c
drivers/thermal/intel/x86_pkg_temp_thermal.c