thermal: ACPI: Discard trips table after zone registration
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 22 Feb 2024 17:15:39 +0000 (18:15 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 23 Feb 2024 17:24:47 +0000 (18:24 +0100)
commit9686f04a7ba6366dbdbb5609dc26a6282803b888
treee279aaa728f2ade949fd64acae49b58ad1bece78
parent9b0a62758665e4d76269bba61eb63e5b8d18e499
thermal: ACPI: Discard trips table after zone registration

Because the thermal core creates and uses its own copy of the trips
table passed to thermal_zone_device_register_with_trips(), it is not
necessary to hold on to a local copy of it any more after the given
thermal zone has been registered.

Accordingly, modify the ACPI thermal driver to store the trips table
passed to thermal_zone_device_register_with_trips() in a local variable
which is automatically discarded when acpi_thermal_add() returns to
its caller.

Also make some additional code simplifications unlocked by the above
change.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/acpi/thermal.c