thermal: core: Initialize poll_queue in thermal_zone_device_init()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 18 Dec 2023 19:26:47 +0000 (20:26 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 28 Dec 2023 13:20:16 +0000 (14:20 +0100)
commit33fcb595dc14678717274c270d02c7d7e0a3c404
tree5b3ac07ee6b600f0330bbaef21a65bec5a9dc940
parent4e814173a8c4f432fd068b1c796f0416328c9d99
thermal: core: Initialize poll_queue in thermal_zone_device_init()

In preparation for a subsequent change, move the initialization of the
poll_queue delayed work from thermal_zone_device_register_with_trips()
to thermal_zone_device_init() which is called by the former.

However, because thermal_zone_device_init() is also called by
thermal_pm_notify(), make the latter call cancel_delayed_work() on
poll_queue before invoking the former, so as to allow the work
item to be re-initialized safely.

Also move thermal_zone_device_check() which needs to be defined
before thermal_zone_device_init(), so the latter can pass it to the
INIT_DELAYED_WORK() macro.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/thermal_core.c